Prechádzať zdrojové kódy

维多利亚部分新需求,多货登记

cz 1 rok pred
rodič
commit
97fa64a0c3

+ 19 - 3
src/components/WDLY/process/SendSubscribeWDLY.vue

@@ -3,10 +3,10 @@
     <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom">
       <template #details>
         <div style="width: 100%">
-          <el-button type="primary" @click="openProduct = true" style="margin-bottom: 10px">
+          <el-button type="primary" @click="openProduct = true" style="margin-bottom: 10px" v-if="!route.query.arr">
             添加物品
           </el-button>
-          <el-button type="primary" @click="openExcel = true" style="margin-bottom: 10px">
+          <el-button type="primary" @click="openExcel = true" style="margin-bottom: 10px" v-if="!route.query.arr">
             excel导入
           </el-button>
           <el-table :data="formData.data.subscribeDetailList" show-summary :summary-method="getSummaries">
@@ -29,7 +29,7 @@
                 </el-form-item>
               </template>
             </el-table-column>
-            <el-table-column prop="zip" label="操作" width="100">
+            <el-table-column prop="zip" label="操作" width="100" v-if="!route.query.arr">
               <template #default="{ $index }">
                 <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
               </template>
@@ -264,6 +264,22 @@ onMounted(() => {
     formData.data.subcribeTime = proxy.parseTime(new Date());
     formData.data.deptName = userInfo.dept.deptName;
     formData.data.subcribeName = userInfo.nickName;
+    if (route.query && route.query.arr) {
+      let list = JSON.parse(route.query.arr);
+      if (list && list.length > 0) {
+        formData.data.subscribeDetailList = list.map((x) => ({
+          goodType: x.goodType,
+          productCode: x.productCustomCode,
+          productName: x.productName,
+          productSpec: x.productSpec,
+          productUnit: x.productUnit,
+          count: x.quantity,
+          bussinessId: x.productId,
+          remark: "",
+          excessGoodsDetailsId: x.id,
+        }));
+      }
+    }
   }
 });
 const downloadTemplate = () => {

+ 12 - 18
src/components/byTable/index.vue

@@ -138,7 +138,7 @@
       <el-row v-if="!hidePagination" class="table-pagination" justify="end" type="flex">
         <el-pagination background layout="total, sizes, prev, pager, next, jumper" :current-page="getPagination.pageNum"
                        :page-size="getPagination.pageSize" :total="getPagination.total" @size-change="handleSizeChange"
-                       @current-change="handlePageChange" />
+                       @current-change="handlePageChange" :page-sizes="pageSizes" />
       </el-row>
     </component>
   </div>
@@ -240,6 +240,10 @@ export default defineComponent({
       type: Boolean,
       default: false,
     },
+    pageSizes: {
+      type: Array,
+      default: [10, 20, 30, 40, 50, 100],
+    },
     // 分页配置
     pagination: {
       type: Object,
@@ -481,21 +485,16 @@ export default defineComponent({
     };
     const hocElTable = ref();
 
-    const updateTableRowClassName = (row) =>{
+    const updateTableRowClassName = (row) => {
       let result = "";
 
-      proxy.$emit(
-          "updateTableRowClassName",
-          row,(val) => {
-            console.log(12312,'12312312')
-            result = val;
-          }
-      );
-
+      proxy.$emit("updateTableRowClassName", row, (val) => {
+        console.log(12312, "12312312");
+        result = val;
+      });
 
       return result;
-    }
-
+    };
 
     return {
       configData,
@@ -525,10 +524,9 @@ export default defineComponent({
       isMore,
       changeStatData,
       hocElTable,
-      updateTableRowClassName
+      updateTableRowClassName,
     };
   },
-
 });
 </script>
 <style>
@@ -551,8 +549,6 @@ export default defineComponent({
   line-height: 34px;
 }
 
-
-
 .el-table .error-row {
   background: rgba(245, 108, 108, 0.68);
 }
@@ -831,6 +827,4 @@ export default defineComponent({
   color: #000 !important;
   font-size: 14px !important;
 }
-
-
 </style>

+ 496 - 0
src/views/WDLY/outInBound/manyGoods/index.vue

@@ -0,0 +1,496 @@
+<template>
+  <div class="tenant">
+    <!-- <Banner /> -->
+    <div class="content">
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
+               :selectConfig="selectConfig" :table-events="{
+          //element talbe事件都能传
+          'selection-change': selectionChange,
+        }" :action-list="[
+        {
+            text: '申购',
+            disabled: selectData.length === 0,
+            action: () => openModal(),
+          },
+         
+        ]" @get-list="getList">
+        <template #code="{ item }">
+          <div style="cursor: pointer; color: #409eff">
+            {{ item.businessCode }}
+          </div>
+        </template>
+        <template #logistics="{ item }">
+          {{ item.logisticsCompanyName }} (
+          <span style="color: #409eff"> {{ item.logisticsCode }} </span>
+          )
+
+        </template>
+      </byTable>
+    </div>
+    <el-dialog title="退货" v-model="dialogVisible" width="50%" destroy-on-close>
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform" v-loading="submitLoading">
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitForm('byform')" size="large" :loading="submitLoading">
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+  
+<script setup>
+/* eslint-disable vue/no-unused-components */
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import { computed, defineComponent, ref } from "vue";
+import useUserStore from "@/store/modules/user";
+import { getToken } from "@/utils/auth";
+const actionUrl = import.meta.env.VITE_APP_BASE_API;
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    type: 1,
+  },
+});
+let dialogVisible = ref(false);
+let roomDialogVisible = ref(false);
+let modalType = ref("add");
+let rules = ref({
+  backLogisticsCode: [
+    { required: true, message: "请输入物流/快递单号", trigger: "blur" },
+  ],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = computed(() => [
+  {
+    label: "处理结果",
+    prop: "processingMethod",
+    data: statusData.value,
+  },
+]);
+const statusData = ref([
+  {
+    label: "未处理",
+    value: "0",
+  },
+  {
+    label: "退货",
+    value: "10",
+  },
+  {
+    label: "入库",
+    value: "20",
+  },
+  {
+    label: "申购",
+    value: "30",
+  },
+]);
+const config = computed(() => {
+  return [
+    {
+      type: "selection",
+      attrs: {
+        checkAtt: "isCheck",
+      },
+    },
+    // {
+    //   attrs: {
+    //     label: "数据来源",
+    //     prop: "businessType",
+    //     width: 100,
+    //   },
+    //   render(type) {
+    //     return businessType.find((x) => x.value == type).label;
+    //   },
+    // },
+    {
+      attrs: {
+        label: "入库单",
+        prop: "businessCode",
+        width: 150,
+      },
+    },
+
+    {
+      attrs: {
+        label: "物流/快递信息",
+        prop: "logisticsCompanyName",
+        slot: "logistics",
+      },
+    },
+    {
+      attrs: {
+        label: "物品编码",
+        prop: "productCustomCode",
+        // width: 150,
+      },
+    },
+    {
+      attrs: {
+        label: "物品名称",
+        prop: "productName",
+      },
+    },
+    {
+      attrs: {
+        label: "物品规格",
+        prop: "productSpec",
+      },
+    },
+    {
+      attrs: {
+        label: "数量",
+        prop: "quantity",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "处理结果",
+        prop: "processingMethod",
+        width: 100,
+      },
+      render(val) {
+        return proxy.dictValueLabel(val, statusData.value);
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "160",
+        align: "center",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          row.processingMethod == 0
+            ? {
+                attrs: {
+                  label: "申购",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  getDtl(row);
+                },
+              }
+            : {},
+          row.processingMethod == 0
+            ? {
+                attrs: {
+                  label: "退货",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  getDtl(row);
+                },
+              }
+            : {},
+          row.processingMethod == 0
+            ? {
+                attrs: {
+                  label: "入库",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  ElMessageBox.confirm("您确定入库吗?", "提示", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning",
+                  }).then(() => {
+                    // 删除
+                    proxy
+                      .post("/excessGoodsDetails/inStock", {
+                        id: row.id,
+                      })
+                      .then((res) => {
+                        ElMessage({
+                          message: "操作成功",
+                          type: "success",
+                        });
+                        getList();
+                      });
+                  });
+                },
+              }
+            : {},
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {},
+  treeData: [],
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const treeData = ref([]);
+const formConfig = computed(() => [
+  {
+    type: "title",
+    title: "基础信息",
+  },
+  {
+    type: "input",
+    prop: "businessCode",
+    label: "单号",
+    disabled: true,
+    itemWidth: 100,
+  },
+  {
+    type: "input",
+    prop: "productCustomCode",
+    label: "物品编码",
+    disabled: true,
+    itemWidth: 50,
+  },
+  {
+    type: "input",
+    prop: "productName",
+    label: "物品名称",
+    disabled: true,
+    itemWidth: 50,
+  },
+  {
+    type: "input",
+    prop: "productSpec",
+    label: "物品规格",
+    disabled: true,
+    itemWidth: 50,
+  },
+  {
+    type: "input",
+    prop: "quantity",
+    label: "数量",
+    disabled: true,
+    itemWidth: 50,
+  },
+  {
+    type: "title",
+    title: "物流信息",
+  },
+  // {
+  //   type: "select",
+  //   prop: "logisticsCompanyCode",
+  //   label: "物流/快递信息",
+  //   placeholder: "物流/快递公司",
+  //   itemWidth: 50,
+  //   style: {
+  //     width: "100%",
+  //   },
+  //   data: logisticsData.value,
+  //   filterable: true,
+  // },
+  {
+    type: "input",
+    prop: "backLogisticsCode",
+    label: "物流/快递单号",
+    // placeholder: "物流/快递单号",
+    itemWidth: 50,
+  },
+]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/excessGoodsDetails/page", sourceList.value.pagination)
+    .then((message) => {
+      sourceList.value.data = message.rows.map((x) => ({
+        ...x,
+        isCheck: x.processingMethod == 0 ? true : false,
+      }));
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
+};
+
+const submitForm = () => {
+  byform.value.handleSubmit((valid) => {
+    // const list = formData.data.stockWaitDetailsList;
+    // const total = list.reduce((total, x) => (total += Number(x.quantity)), 0);
+    // if (!(total > 0)) {
+    //   return ElMessage({
+    //     message: `本次入库不能为0!`,
+    //     type: "info",
+    //   });
+    // }
+    // for (let i = 0; i < list.length; i++) {
+    //   const e = list[i];
+    //   if (Number(e.receiptQuantity) + e.quantity > Number(e.arrivalQuantity)) {
+    //     return ElMessage({
+    //       message: "本次入库加已入库数量不可大于发货数量!",
+    //       type: "info",
+    //     });
+    //   }
+    // }
+    submitLoading.value = true;
+    proxy.post("/excessGoodsDetails/backGoods", formData.data).then(
+      (res) => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => (submitLoading.value = false)
+    );
+  });
+};
+
+const getDtl = (row) => {
+  modalType.value = "edit";
+  formData.data = {
+    businessCode: row.businessCode,
+    productCustomCode: row.productCustomCode,
+    productName: row.productName,
+    productSpec: row.productSpec,
+    quantity: row.quantity,
+    id: row.id,
+    backLogisticsCode: "",
+  };
+  dialogVisible.value = true;
+};
+const warehouseType = ref([]);
+const logisticsData = ref([]);
+const getDict = () => {
+  // proxy
+  //   .post("/dictTenantData/page", {
+  //     pageNum: 1,
+  //     pageSize: 999,
+  //     tenantId: useUserStore().user.tenantId,
+  //     dictCode: "warehouse_type",
+  //   })
+  //   .then((res) => {
+  //     warehouseType.value = res.rows;
+  //   });
+  proxy
+    .post("/companyInfo/list", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      logisticsData.value = res.reverse();
+      logisticsData.value = logisticsData.value.map((x) => ({
+        label: x.name,
+        value: x.code,
+      }));
+    });
+};
+
+const businessType = [
+  { label: "线边回仓", value: "1" },
+  { label: "完工入库", value: "2" },
+  { label: "采购到货", value: "3" },
+  { label: "退货出库", value: "4" },
+];
+
+getList();
+getDict();
+onMounted(() => {});
+const selectData = ref([]);
+const selectionChange = (data) => {
+  selectData.value = data;
+};
+
+const openModal = () => {
+  proxy.$router.push({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "wdly_apply_purchase",
+      flowName: "申购发起",
+      random: proxy.random(),
+      arr: JSON.stringify(selectData.value),
+    },
+  });
+};
+
+const deriveExcel = () => {
+  ElMessage({
+    message: "请稍后",
+    type: "success",
+  });
+  proxy
+    .postTwo(
+      "/stockWait/inStockWaitExportExcel",
+      selectData.value.map((x) => x.id)
+    )
+    .then((res) => {
+      const content = res;
+      const blob = new Blob([content], { type: "application/ms-excel" });
+      const fileName = "待入库.xlsx";
+      if ("download" in document.createElement("a")) {
+        // 非IE下载
+        const elink = document.createElement("a");
+        elink.download = fileName;
+        elink.style.display = "none";
+        elink.href = URL.createObjectURL(blob);
+        document.body.appendChild(elink);
+        elink.click();
+        URL.revokeObjectURL(elink.href); // 释放URL 对象
+        document.body.removeChild(elink);
+      } else {
+        navigator.msSaveBlob(blob, fileName);
+      }
+    });
+};
+
+const getSummaries = (param) => {
+  const { columns, data } = param; //columns是每列的信息,data是每行的信息
+  const sums = [];
+  columns.forEach((column, index) => {
+    if (index === 0) {
+      sums[index] = "合计"; //此处是在index=0的这一列显示为“合计”
+      return;
+    }
+    const values = data.map((item) => Number(item[column.property]));
+    if (
+      column.property === "purchaseQuantity" ||
+      column.property === "arrivalQuantity" ||
+      column.property === "receiptQuantity" ||
+      column.property === "quantity"
+    ) {
+      sums[index] = values.reduce((prev, curr) => {
+        const value = Number(curr);
+        if (!isNaN(value)) {
+          return Number(parseFloat(prev + curr).toFixed(4));
+        } else {
+          return prev;
+        }
+      }, 0);
+      sums[index];
+    }
+  });
+  return sums;
+};
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+:deep(.el-table__header-wrapper .el-checkbox) {
+  display: none;
+}
+</style>

+ 5 - 5
src/views/WDLY/outInBound/waitInBound/index.vue

@@ -114,10 +114,6 @@ const inboundType = ref([
 const config = computed(() => {
   return [
     {
-      type: "selection",
-      width: 60,
-    },
-    {
       attrs: {
         label: "数据来源",
         prop: "businessType",
@@ -368,7 +364,11 @@ const getDtl = (row) => {
       stockWaitDetailsList: res.stockWaitDetailsList.map((x) => ({
         ...x,
         arrivalQuantity: x.quantity,
-        quantity: undefined,
+        quantity: x.stockWaitDetailsCheckList
+          ? x.stockWaitDetailsCheckList
+              .filter((x) => x.status != 2)
+              .reduce((total, y) => (total += Number(y.quantity)), 0)
+          : 0,
       })),
     };
     dialogVisible.value = true;

+ 100 - 3
src/views/WDLY/purchaseManage/alreadyPurchase/index.vue

@@ -36,6 +36,7 @@
               >修改</el-button
             > -->
             <el-button type="primary" v-if="item.purchaseStatus == 30" link @click="handleReturnGoods(item)">退货</el-button>
+            <el-button type="primary" v-if="item.purchaseStatus == 30" link @click="handleUploadFile(item)">合同上传</el-button>
             <el-button type="primary" link v-if="item.purchaseStatus == 30 && item.purchaseStatus != 99"
                        @click="handleArrival(item, 'add')">发货登记</el-button>
             <el-button type="primary" link v-if="item.purchaseStatus == 30 && item.purchaseStatus != 99"
@@ -478,6 +479,20 @@
         <el-button @click="payDialog = false" size="large">关 闭</el-button>
       </template>
     </el-dialog>
+
+    <el-dialog :title="'合同上传'" v-model="uploadDialog" width="600" destroy-on-close>
+      <el-upload :file-list="uploadFormData.fileList" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" :data="uploadData" multiple
+                 :before-upload="handleBeforeUpload" :on-success="handleSuccess" :on-preview="onPreviewFile">
+        <el-button type="primary" plain>选择</el-button>
+      </el-upload>
+      <template #footer>
+        <el-button @click="uploadDialog = false" size="large">关 闭</el-button>
+        <el-button type="primary" @click="submitUploadForm()" size="large" :loading="loadingTwo">
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+
   </div>
 </template>
   
@@ -1233,6 +1248,90 @@ const handleReturnGoods = (row) => {
     dialogVisibleTwo.value = true;
   });
 };
+
+const uploadDialog = ref(false);
+const uploadFileList = ref([]);
+const uploadData = ref({});
+const fileData = ref({});
+const uploadFormData = ref({});
+const handleUploadFile = (row) => {
+  uploadFormData.value = {
+    id: row.id,
+    fileList: [],
+  };
+  proxy
+    .post("/fileInfo/getList", { businessIdList: [row.id] })
+    .then((fileObj) => {
+      uploadFormData.value.fileList = fileObj[row.id] || [];
+      if (
+        uploadFormData.value.fileList &&
+        uploadFormData.value.fileList.length > 0
+      ) {
+        uploadFormData.value.fileList = uploadFormData.value.fileList.map(
+          (item) => {
+            return {
+              raw: item,
+              name: item.fileName,
+              url: item.fileUrl,
+            };
+          }
+        );
+      }
+    });
+  uploadDialog.value = true;
+};
+
+const handleBeforeUpload = async (file) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  uploadData.value = res.uploadBody;
+  fileData.value = res;
+  file.id = res.id;
+  file.fileUrl = res.fileUrl;
+  return true;
+};
+
+const handleSuccess = () => {
+  if (fileData.value && fileData.value.id) {
+    uploadFormData.value.fileList.push({
+      id: fileData.value.id,
+      fileName: fileData.value.fileName,
+      path: fileData.value.fileUrl,
+      url: fileData.value.fileUrl,
+      fileUrl: fileData.value.fileUrl,
+    });
+  }
+};
+
+const onPreviewFile = (file, a) => {
+  if (file && file.fileUrl) {
+    window.open(file.fileUrl, "_blank");
+  } else {
+    window.open(file.raw.fileUrl, "_blank");
+  }
+};
+
+const submitUploadForm = () => {
+  if (
+    uploadFormData.value.fileList &&
+    uploadFormData.value.fileList.length > 0
+  ) {
+    proxy
+      .post("/purchase/updateAttachment", uploadFormData.value)
+      .then((res) => {
+        ElMessage({
+          message: `操作成功`,
+          type: "success",
+        });
+        uploadDialog.value = false;
+      });
+  } else {
+    ElMessage({
+      message: `请上传`,
+      type: "info",
+    });
+  }
+};
+
 const countryData = ref([]);
 const provinceData = ref([]);
 const cityData = ref([]);
@@ -1664,9 +1763,6 @@ const handleChangeMoney = (val, index, key) => {
   handleChangeAmount();
 };
 
-const onPreviewFile = (file) => {
-  window.open(file.raw.fileUrl, "_blank");
-};
 const submitUpdate = () => {
   purchaseDom.value.handleSubmit(() => {
     loadingTwo.value = true;
@@ -1826,6 +1922,7 @@ const updateCode = (row) => {
   };
   updateCodeDialog.value = true;
 };
+
 const submitUpdateCode = () => {
   updateCodeDom.value.handleSubmit(() => {
     loadingTwo.value = true;

+ 2 - 2
src/views/WDLY/purchaseManage/purchase/index.vue

@@ -2,8 +2,8 @@
   <div class="tenant">
     <!-- <Banner /> -->
     <div class="content">
-      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
-               :selectConfig="selectConfig" :table-events="{
+      <byTable :source="sourceList.data" :pageSizes="[10, 20, 30, 40, 50, 100, 200]" :pagination="sourceList.pagination" :config="config"
+               :loading="loading" highlight-current-row :selectConfig="selectConfig" :table-events="{
           //element talbe事件都能传
           select: (data) => selectRow(data, 'row'),
           'select-all': (data) => selectAll(data, 'all'),