Răsfoiți Sursa

Merge branch 'master' into 外箱包装功能修改

lxf 1 an în urmă
părinte
comite
3a5dd87056
33 a modificat fișierele cu 775 adăugiri și 317 ștergeri
  1. 4 1
      src/components/byTable/index.vue
  2. 2 1
      src/main.js
  3. 20 0
      src/utils/request.js
  4. 1 1
      src/views/group/data-board/material-in-transit/index.vue
  5. 42 6
      src/views/group/data-board/sku-quoted-price/index.vue
  6. 48 11
      src/views/group/data-board/turnover-rate/index.vue
  7. 16 6
      src/views/group/finance/check-bill/ExcelFile.vue
  8. 2 1
      src/views/group/finance/check-bill/printBOM.vue
  9. 0 1
      src/views/group/finance/check-bill/printOrder.vue
  10. 2 1
      src/views/group/finance/check-bill/printSKU.vue
  11. 2 1
      src/views/group/finance/sales-return/index.vue
  12. 0 1
      src/views/group/finance/sales-shipment/index.vue
  13. 1 0
      src/views/group/finance/summary/index.vue
  14. 2 1
      src/views/group/finance/summary/printBOM.vue
  15. 0 1
      src/views/group/finance/summary/printOrder.vue
  16. 2 1
      src/views/group/finance/summary/printSKU.vue
  17. 39 1
      src/views/group/oa/subscribe/index.vue
  18. 27 12
      src/views/group/order/management/index.vue
  19. 0 15
      src/views/group/order/product-management/index.vue
  20. 62 0
      src/views/group/product/management/index.vue
  21. 25 18
      src/views/production/operation/overclaim/index.vue
  22. 316 0
      src/views/production/operation/production-error/index.vue
  23. 2 1
      src/views/production/warehouse/check/index.vue
  24. 76 72
      src/views/production/warehouse/finished-parts-storage/index.vue
  25. 3 2
      src/views/production/warehouse/flow-record/index.vue
  26. 3 2
      src/views/production/warehouse/inventory/index.vue
  27. 4 3
      src/views/production/warehouse/outbound/index.vue
  28. 35 113
      src/views/production/warehouse/purchase-stock-pending/add.vue
  29. 19 11
      src/views/production/warehouse/putInStorage/index.vue
  30. 18 10
      src/views/subsidiary/order/management/add.vue
  31. 0 11
      src/views/subsidiary/order/management/index.vue
  32. 0 11
      src/views/subsidiary/order/productManagement/index.vue
  33. 2 1
      src/views/subsidiary/warehouse/inventory/index.vue

+ 4 - 1
src/components/byTable/index.vue

@@ -130,6 +130,9 @@
           :selectable="(rowData, rowIndex) => isSelectable(rowData, rowIndex, item)"
           :sortable="item.sortable || false"
           :prop="item.attrs.prop">
+          <template #header v-if="item.header">
+            <slot :name="item.attrs.slotHeader" v-if="item.attrs.slotHeader"> 插槽占位符 </slot>
+          </template>
           <template #default="scope" v-if="!item.type">
             <slot :name="item.attrs.slot" :item="scope.row" v-if="item.attrs.slot"> 插槽占位符 </slot>
             <div v-else-if="isFunction(getValue(scope, item))">
@@ -217,7 +220,7 @@ export default defineComponent({
       },
     },
     tableHeight: {
-      type: Number,
+      type: String,
       required: false,
     },
     // 指定外层容器的渲染组件

+ 2 - 1
src/main.js

@@ -15,7 +15,7 @@ import useUserStore from "/src/store/modules/user";
 
 // 注册指令
 import plugins from "./plugins"; // plugins
-import { download, post, postFile, get, getFile, postUploadFile } from "/src/utils/request";
+import { download, post, postFile, get, getFile, postUploadFile, postUploadAndDownloadFile } from "/src/utils/request";
 
 // svg图标
 import "virtual:svg-icons-register";
@@ -71,6 +71,7 @@ app.config.globalProperties.get = get;
 app.config.globalProperties.post = post;
 app.config.globalProperties.postFile = postFile;
 app.config.globalProperties.postUploadFile = postUploadFile;
+app.config.globalProperties.postUploadAndDownloadFile = postUploadAndDownloadFile;
 app.config.globalProperties.getFile = getFile;
 app.config.globalProperties.download = download;
 app.config.globalProperties.parseTime = parseTime;

+ 20 - 0
src/utils/request.js

@@ -276,4 +276,24 @@ export function postUploadFile(url, data = {}, method) {
   });
 }
 
+export function postUploadAndDownloadFile(url, data = {}, method) {
+  return new Promise((resolve, reject) => {
+    service({
+      method: method || "post",
+      url: url,
+      data: data,
+      headers: {
+        "Content-Type": "multipart/form-data",
+      },
+      responseType: "blob",
+    })
+      .then((res) => {
+        resolve(res);
+      })
+      .catch((err) => {
+        reject(err);
+      });
+  });
+}
+
 export default service;

+ 1 - 1
src/views/group/data-board/material-in-transit/index.vue

@@ -155,7 +155,7 @@ const deriveExcel = () => {
   })
     .then(() => {
       proxy.postFile("/purchaseInTransitBom/export", sourceList.value.pagination).then((res) => {
-        proxy.downloadFile(res, "在途物料.xlsx");
+        proxy.downloadFile(res, "在途物料-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     })
     .catch(() => {});

+ 42 - 6
src/views/group/data-board/sku-quoted-price/index.vue

@@ -14,6 +14,7 @@
           action: () => deriveExcel(),
         },
       ]"
+      :tableHeight="'calc(100vh - 242px)'"
       @get-list="getList"
       @clickReset="clickReset">
       <template #skuPrice>
@@ -38,6 +39,7 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const departmentList = ref([]);
@@ -47,7 +49,9 @@ const sourceList = ref({
     total: 0,
     departmentId: proxy.useUserStore().user.deptId,
     skuSpecCode: "",
-    skuSpecName: "",
+    bomSpecCode: "",
+    colour: "",
+    chromatophore: "",
   },
 });
 const loading = ref(false);
@@ -68,8 +72,19 @@ const searchConfig = computed(() => {
     },
     {
       type: "input",
-      prop: "skuSpecName",
-      label: "SKU品名",
+      prop: "bomSpecCode",
+      label: "BOM品号",
+    },
+    {
+      type: "input",
+      prop: "colour",
+      label: "颜色",
+    },
+    {
+      type: "select",
+      prop: "chromatophore",
+      dictKey: "bom_chromatophore",
+      label: "色层",
     },
   ];
 });
@@ -86,14 +101,35 @@ const config = computed(() => {
       attrs: {
         label: "SKU品号",
         prop: "skuSpecCode",
-        width: 160,
+        width: 140,
       },
     },
     {
       attrs: {
         label: "SKU品名",
         prop: "skuSpecName",
-        "min-width": 220,
+        "min-width": 320,
+      },
+    },
+    {
+      attrs: {
+        label: "BOM品号",
+        prop: "bomSpecCode",
+        width: 130,
+      },
+    },
+    {
+      attrs: {
+        label: "颜色",
+        prop: "colour",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "色层",
+        prop: "chromatophore",
+        width: 120,
       },
     },
     {
@@ -157,7 +193,7 @@ const deriveExcel = () => {
   })
     .then(() => {
       proxy.postFile("/skuSpecQuotationBoard/exportExcel", sourceList.value.pagination).then((res) => {
-        proxy.downloadFile(res, "SKU报价看板.xlsx");
+        proxy.downloadFile(res, "SKU报价看板-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     })
     .catch(() => {});

+ 48 - 11
src/views/group/data-board/turnover-rate/index.vue

@@ -26,6 +26,7 @@
           action: () => deriveExcel(),
         },
       ]"
+      :tableHeight="'calc(100vh - 297px)'"
       @get-list="getList"
       @clickReset="clickReset">
       <template #bomSpecName="{ item }">
@@ -40,6 +41,33 @@
           </el-tooltip>
         </div>
       </template>
+      <template #turnoverRateThirtyDays>
+        <span>30天周转率</span>
+        <el-tooltip class="box-item" effect="dark" placement="bottom">
+          <template #content>
+            <div>库存周转率=时间段天数/(时间段天数X (1/2) X (期初库存数量+期末库存数量)/时间段销售量)</div>
+          </template>
+          <el-icon style="cursor: pointer; margin-left: 4px; transform: translateY(2px)"><QuestionFilled /></el-icon>
+        </el-tooltip>
+      </template>
+      <template #turnoverRateSixtyDays>
+        <span>60天周转率</span>
+        <el-tooltip class="box-item" effect="dark" placement="bottom">
+          <template #content>
+            <div>库存周转率=时间段天数/(时间段天数X (1/2) X (期初库存数量+期末库存数量)/时间段销售量)</div>
+          </template>
+          <el-icon style="cursor: pointer; margin-left: 4px; transform: translateY(2px)"><QuestionFilled /></el-icon>
+        </el-tooltip>
+      </template>
+      <template #turnoverRateNinetyDays>
+        <span>90天周转率</span>
+        <el-tooltip class="box-item" effect="dark" placement="bottom">
+          <template #content>
+            <div>库存周转率=时间段天数/(时间段天数X (1/2) X (期初库存数量+期末库存数量)/时间段销售量)</div>
+          </template>
+          <el-icon style="cursor: pointer; margin-left: 4px; transform: translateY(2px)"><QuestionFilled /></el-icon>
+        </el-tooltip>
+      </template>
     </byTable>
   </el-card>
 </template>
@@ -48,6 +76,7 @@
 import byTable from "/src/components/byTable/index";
 import { nextTick } from "vue";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const activeName = ref("1");
@@ -63,14 +92,16 @@ const sourceList = ref({
 const searchConfig = computed(() => {
   return [
     {
-      type: "input",
+      type: "select",
       prop: "width",
-      label: "宽",
+      dictKey: "width_size",
+      label: "宽度",
     },
     {
-      type: "input",
+      type: "select",
       prop: "height",
-      label: "高",
+      dictKey: "height_size",
+      label: "厚度",
     },
     {
       type: "select",
@@ -98,14 +129,14 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "宽",
+        label: "宽",
         prop: "width",
         width: 80,
       },
     },
     {
       attrs: {
-        label: "",
+        label: "厚度",
         prop: "height",
         width: 80,
       },
@@ -121,9 +152,11 @@ const config = computed(() => {
       attrs: {
         label: "30天周转率",
         prop: "turnoverRateThirtyDays",
-        width: 130,
+        width: 140,
+        slotHeader: "turnoverRateThirtyDays",
       },
       sortable: true,
+      header: true,
     },
     {
       attrs: {
@@ -136,9 +169,11 @@ const config = computed(() => {
       attrs: {
         label: "60天周转率",
         prop: "turnoverRateSixtyDays",
-        width: 130,
+        width: 140,
+        slotHeader: "turnoverRateSixtyDays",
       },
       sortable: true,
+      header: true,
     },
     {
       attrs: {
@@ -151,9 +186,11 @@ const config = computed(() => {
       attrs: {
         label: "90天周转率",
         prop: "turnoverRateNinetyDays",
-        width: 130,
+        width: 140,
+        slotHeader: "turnoverRateNinetyDays",
       },
       sortable: true,
+      header: true,
     },
     {
       attrs: {
@@ -200,9 +237,9 @@ const deriveExcel = () => {
     .then(() => {
       proxy.postFile("/turnoverRateBoard/exportExcel", { bomClassify: activeName.value, ...sourceList.value.pagination }).then((res) => {
         if (activeName.value == "1") {
-          proxy.downloadFile(res, "周转率-裸垫.xlsx");
+          proxy.downloadFile(res, "周转率-裸垫-" + moment().format("yyyy-MM-DD") + ".xlsx");
         } else {
-          proxy.downloadFile(res, "周转率-裸砖.xlsx");
+          proxy.downloadFile(res, "周转率-裸砖-" + moment().format("yyyy-MM-DD") + ".xlsx");
         }
       });
     })

+ 16 - 6
src/views/group/finance/check-bill/ExcelFile.vue

@@ -7,12 +7,6 @@
       :loading="loading"
       :searchConfig="searchConfig"
       highlight-current-row
-      :action-list="[
-        // {
-        //   text: '刷新',
-        //   action: () => getList(),
-        // },
-      ]"
       @get-list="getList">
     </byTable>
   </div>
@@ -155,6 +149,7 @@ const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy.post("/excelGenerateLog/page", sourceList.value.pagination).then((res) => {
+    console.log(res.rows);
     sourceList.value.data = res.rows;
     sourceList.value.pagination.total = res.total;
     setTimeout(() => {
@@ -189,6 +184,21 @@ const clickDelete = (row) => {
     })
     .catch(() => {});
 };
+const timer = ref(null);
+const startTimer = () => {
+  timer.value = setInterval(() => {
+    if (sourceList.value.data && sourceList.value.data.length > 0) {
+      let list = sourceList.value.data.filter((item) => [1, 2, 3].includes(item.status));
+      if (list && list.length > 0) {
+        getList();
+      }
+    }
+  }, 5000);
+};
+startTimer();
+onBeforeUnmount(() => {
+  clearInterval(timer.value); // 清除定时器
+});
 </script>
 
 <style lang="scss" scoped></style>

+ 2 - 1
src/views/group/finance/check-bill/printBOM.vue

@@ -39,6 +39,7 @@
 
 <script setup>
 import { ElMessage } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const props = defineProps({
@@ -191,7 +192,7 @@ const deriveExcel = () => {
   loading.value = true;
   proxy.getFile("/statementOfAccount/exportDocumentByBom", { id: props.rowData.id, orderClassify: props.tabValues.tabsCard }).then(
     (res) => {
-      proxy.downloadFile(res, "BOM对账单.xlsx");
+      proxy.downloadFile(res, "BOM对账单-" + moment().format("yyyy-MM-DD") + ".xlsx");
       loading.value = false;
     },
     (err) => {

+ 0 - 1
src/views/group/finance/check-bill/printOrder.vue

@@ -131,7 +131,6 @@ const deriveExcel = () => {
   proxy.getFile("/statementOfAccount/exportDocumentByOrder", { id: props.rowData.id, orderClassify: props.tabValues.tabsCard }).then(
     () => {
       emit("clickCancel", true);
-      // proxy.downloadFile(res, "订单对账单.xlsx");
       loading.value = false;
     },
     (err) => {

+ 2 - 1
src/views/group/finance/check-bill/printSKU.vue

@@ -33,6 +33,7 @@
 
 <script setup>
 import { ElMessage } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const props = defineProps({
@@ -178,7 +179,7 @@ const deriveExcel = () => {
   loading.value = true;
   proxy.getFile("/statementOfAccount/exportDocumentBySku", { id: props.rowData.id, orderClassify: props.tabValues.tabsCard }).then(
     (res) => {
-      proxy.downloadFile(res, "SKU对账单.xlsx");
+      proxy.downloadFile(res, "SKU对账单-" + moment().format("yyyy-MM-DD") + ".xlsx");
       loading.value = false;
     },
     (err) => {

+ 2 - 1
src/views/group/finance/sales-return/index.vue

@@ -23,6 +23,7 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
@@ -197,7 +198,7 @@ const deriveExcel = () => {
   })
     .then(() => {
       proxy.getFile("/orderExchangeDetail/excelExport", sourceList.value.pagination).then((res) => {
-        proxy.downloadFile(res, "销售退货明细表.xlsx");
+        proxy.downloadFile(res, "销售退货明细表-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     })
     .catch(() => {});

+ 0 - 1
src/views/group/finance/sales-shipment/index.vue

@@ -58,7 +58,6 @@
           {{ moneyFormat(row.subtotal) }}
         </template>
       </el-table-column>
-      <el-table-column label="外箱包装费" prop="outerBoxPackingFee" align="center" width="100" />
       <el-table-column label="合计" align="center" width="120">
         <template #default="{ row }">
           {{ moneyFormat(row.total) }}

+ 1 - 0
src/views/group/finance/summary/index.vue

@@ -196,6 +196,7 @@ const getList = async (req, status) => {
     sourceList.value.pagination = {
       pageNum: sourceList.value.pagination.pageNum,
       pageSize: sourceList.value.pagination.pageSize,
+      type: 1,
     };
   } else {
     sourceList.value.pagination = { ...sourceList.value.pagination, ...req };

+ 2 - 1
src/views/group/finance/summary/printBOM.vue

@@ -39,6 +39,7 @@
 
 <script setup>
 import { ElMessage } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const props = defineProps({
@@ -198,7 +199,7 @@ const deriveExcel = () => {
     })
     .then(
       (res) => {
-        proxy.downloadFile(res, "BOM对账单.xlsx");
+        proxy.downloadFile(res, "BOM对账单-" + moment().format("yyyy-MM-DD") + ".xlsx");
         loading.value = false;
       },
       (err) => {

+ 0 - 1
src/views/group/finance/summary/printOrder.vue

@@ -137,7 +137,6 @@ const deriveExcel = () => {
     .then(
       () => {
         emit("clickCancel", true);
-        // proxy.downloadFile(res, "订单对账单.xlsx");
         loading.value = false;
       },
       (err) => {

+ 2 - 1
src/views/group/finance/summary/printSKU.vue

@@ -33,6 +33,7 @@
 
 <script setup>
 import { ElMessage } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const props = defineProps({
@@ -185,7 +186,7 @@ const deriveExcel = () => {
     })
     .then(
       (res) => {
-        proxy.downloadFile(res, "SKU对账单.xlsx");
+        proxy.downloadFile(res, "SKU对账单-" + moment().format("yyyy-MM-DD") + ".xlsx");
         loading.value = false;
       },
       (err) => {

+ 39 - 1
src/views/group/oa/subscribe/index.vue

@@ -29,6 +29,7 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { flowStatus } from "/src/utils/flowStatus";
+import { ElMessage } from "element-plus";
 
 const { proxy } = getCurrentInstance();
 const sourceList = ref({
@@ -107,12 +108,34 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: 80,
+        width: 220,
         align: "center",
         fixed: "right",
       },
       renderHTML(row) {
         return [
+          {
+            attrs: {
+              label: "下载",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              clickUpload(row);
+            },
+          },
+          {
+            attrs: {
+              label: "重新生成",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              clickRefresh(row);
+            },
+          },
           row.flowStatus == "0"
             ? {
                 attrs: {
@@ -188,6 +211,21 @@ const clickUpdate = (item) => {
     },
   });
 };
+const clickUpload = (item) => {
+  proxy.post("/fileInfo/getList", { businessIdList: [item.id] }).then((fileObj) => {
+    if (fileObj[item.id] && fileObj[item.id].length > 0) {
+      window.open(fileObj[item.id][0].fileUrl);
+    } else {
+      return ElMessage("请重新生成文件");
+    }
+  });
+};
+const clickRefresh = (item) => {
+  ElMessage("生成文件中,请勿重复点击");
+  proxy.post("/applyBuy/updateApplyBuyAccessory", { id: item.id }).then(() => {
+    ElMessage({ message: "重新生成成功", type: "success" });
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 27 - 12
src/views/group/order/management/index.vue

@@ -367,17 +367,6 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "外箱包装费 ¥",
-        prop: "outerBoxPackingFee",
-        width: 120,
-        align: "right",
-      },
-      render(val) {
-        return proxy.moneyFormat(val);
-      },
-    },
-    {
-      attrs: {
         label: "交期",
         prop: "deliveryTime",
         width: 160,
@@ -416,12 +405,25 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: 240,
+        width: 180,
         align: "center",
         fixed: "right",
       },
       renderHTML(row) {
         return [
+          !props.selectStatus && row.status == 40
+            ? {
+                attrs: {
+                  label: "导出",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  deriveExcel(row);
+                },
+              }
+            : {},
           {
             attrs: {
               label: "修改包装配置",
@@ -767,6 +769,19 @@ const clickCancel = (status) => {
     getList();
   }
 };
+const deriveExcel = (row) => {
+  ElMessageBox.confirm("你是否确认此操作", "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  })
+    .then(() => {
+      proxy.postFile("/orderInfo/orderExportExcel", { id: row.id }).then((res) => {
+        proxy.downloadFile(res, row.code + ".xlsx");
+      });
+    })
+    .catch(() => {});
+};
 const formData = reactive({
   data: {
     orderPackageBomList: [],

+ 0 - 15
src/views/group/order/product-management/index.vue

@@ -274,21 +274,6 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "外箱包装费 ¥",
-        prop: "outerBoxPackingFee",
-        width: 110,
-        align: "right",
-      },
-      render(val) {
-        // if (val) {
-        //   return proxy.moneyFormat(val);
-        // } else {
-          return 0;
-        // }
-      },
-    },
-    {
-      attrs: {
         label: "下单时间",
         slot: "wlnCreateTime",
         width: 160,

+ 62 - 0
src/views/group/product/management/index.vue

@@ -28,6 +28,18 @@
                 text: '批量修改包材',
                 action: () => batchPackagingModification(),
               },
+          props.selectStatus
+            ? {}
+            : {
+                text: '手动同步SKU',
+                action: () => clickSynchronization(),
+              },
+          props.selectStatus
+            ? {}
+            : {
+                text: '导入SKU',
+                action: () => clickImport(),
+              },
           // {
           //   text: '操作日志',
           //   action: () => viewLogs(),
@@ -101,6 +113,17 @@
     <el-dialog title="批量修改包材" v-if="openPackagingModification" v-model="openPackagingModification" width="96%">
       <ModificationSubsidiary @clickCancel="clickPackagingModificationCancel"></ModificationSubsidiary>
     </el-dialog>
+
+    <el-dialog title="导入SKU" v-if="openUpload" v-model="openUpload" width="600">
+      <div v-loading="loadingUpload">
+        <el-upload :show-file-list="false" action="##" :http-request="uploadServerLog" :before-upload="handleBeforeUpload">
+          <el-button style="background: #20b2aa; color: #fff; border: 1px solid #20b2aa">上传</el-button>
+        </el-upload>
+        <div style="text-align: center; margin: 10px">
+          <el-button @click="openUpload = false" size="large">关 闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -109,6 +132,7 @@ import byTable from "/src/components/byTable/index";
 import MakeSKU from "/src/components/makeProduct/index";
 import Modification from "/src/components/makeProduct/modification/index";
 import ModificationSubsidiary from "/src/components/makeProduct/modification/subsidiary";
+import { ElMessage } from "element-plus";
 
 const { proxy } = getCurrentInstance();
 const props = defineProps({
@@ -397,6 +421,44 @@ const clickPackagingModificationCancel = (status) => {
     getList();
   }
 };
+const clickSynchronization = () => {
+  loading.value = true;
+  proxy.post("/orderHandle/syncSku", {}).then(
+    () => {
+      ElMessage({ message: "同步完成", type: "success" });
+      getList();
+    },
+    (err) => {
+      console.log(err);
+      loading.value = false;
+    }
+  );
+};
+const openUpload = ref(false);
+const loadingUpload = ref(false);
+const clickImport = () => {
+  loadingUpload.value = false;
+  openUpload.value = true;
+};
+const handleBeforeUpload = () => {
+  loadingUpload.value = true;
+};
+const uploadServerLog = (params) => {
+  let file = params.file;
+  let formData = new FormData();
+  formData.append("file", file);
+  proxy.postUploadFile("/skuSpec/skuSpecImport", formData).then(
+    () => {
+      ElMessage({ message: "导入成功", type: "success" });
+      openUpload.value = false;
+      getList();
+    },
+    (err) => {
+      console.log(err);
+      loadingUpload.value = false;
+    }
+  );
+};
 </script>
 
 <style lang="scss" scoped>

+ 25 - 18
src/views/production/operation/overclaim/index.vue

@@ -6,16 +6,16 @@
           <el-select-v2 v-model="formData.data.orderId" :options="productionOrder" placeholder="请选择订单号" @change="changeOrder()" style="width: 100%" filterable />
         </div>
       </template>
-      <template #productionCostList>
+      <template #productionExceedReceiveSkuList>
         <div style="width: 100%">
-          <el-table :data="formData.data.productionCostList" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
+          <el-table :data="formData.data.productionExceedReceiveSkuList" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
             <el-table-column label="SKU品号" prop="code" width="160" />
             <el-table-column label="SKU品名" prop="name" min-width="220" />
             <el-table-column label="BOM品号" prop="bomCode" width="160" />
             <el-table-column label="订单数量" prop="orderQuantity" width="120" />
             <el-table-column label="超领数量" width="160">
               <template #default="{ row, $index }">
-                <el-form-item :prop="'productionCostList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true" style="width: 100%">
+                <el-form-item :prop="'productionExceedReceiveSkuList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true" style="width: 100%">
                   <el-input-number
                     onmousewheel="return false;"
                     v-model="row.quantity"
@@ -45,7 +45,7 @@ import { ElMessage } from "element-plus";
 
 const { proxy } = getCurrentInstance();
 const productionOrder = ref([]);
-const exceedReceiveReasonList = ref([
+const typeList = ref([
   {
     dictKey: 1,
     dictValue: "制作损坏",
@@ -88,8 +88,8 @@ const formOption = reactive({
 const formData = reactive({
   data: {
     orderId: "",
-    exceedReceiveReason: "",
-    productionCostList: [],
+    type: "",
+    productionExceedReceiveSkuList: [],
   },
 });
 const formConfig = computed(() => {
@@ -104,27 +104,34 @@ const formConfig = computed(() => {
     {
       type: "select",
       label: "超领原因",
-      prop: "exceedReceiveReason",
-      data: exceedReceiveReasonList.value,
+      prop: "type",
+      data: typeList.value,
+      itemWidth: 51,
+    },
+    {
+      type: "input",
+      label: "责任人",
+      prop: "responsible",
       itemWidth: 51,
     },
     {
       type: "slot",
-      slotName: "productionCostList",
+      slotName: "productionExceedReceiveSkuList",
       label: "订单商品",
     },
   ];
 });
 const rules = ref({
   orderId: [{ required: true, message: "请选择订单号", trigger: "change" }],
-  exceedReceiveReason: [{ required: true, message: "请选择超领原因", trigger: "change" }],
+  type: [{ required: true, message: "请选择超领原因", trigger: "change" }],
   quantity: [{ required: true, message: "请输入超领数量", trigger: "blur" }],
+  responsible: [{ required: true, message: "请输入责任人", trigger: "blur" }],
 });
 const submitForm = () => {
   submit.value.handleSubmit(() => {
-    if (formData.data.productionCostList && formData.data.productionCostList.length > 0) {
+    if (formData.data.productionExceedReceiveSkuList && formData.data.productionExceedReceiveSkuList.length > 0) {
       proxy.post("/productionExceedReceive/exceedReceive", formData.data).then(() => {
-        ElMessage({ message: "选择完成", type: "success" });
+        ElMessage({ message: "操作完成", type: "success" });
         clickCancel();
       });
     } else {
@@ -134,7 +141,7 @@ const submitForm = () => {
 };
 const clickCancel = () => {
   formData.data = {
-    productionCostList: [],
+    productionExceedReceiveSkuList: [],
   };
   submit.value.resetFields();
 };
@@ -142,23 +149,23 @@ const changeOrder = () => {
   if (formData.data.orderId) {
     proxy.post("/productionExceedReceive/getOrderSkuList", { id: formData.data.orderId }).then((res) => {
       if (res && res.length > 0) {
-        formData.data.productionCostList = res.map((item) => {
+        formData.data.productionExceedReceiveSkuList = res.map((item) => {
           return {
-            bomSpecId: item.bomSpecId,
+            orderSkuId: item.id,
+            skuSpecId: item.skuSpecId,
             name: item.name,
             code: item.code,
             bomCode: item.bomCode,
             quantity: undefined,
             orderQuantity: item.quantity,
-            id: item.id,
           };
         });
       } else {
-        formData.data.productionCostList = [];
+        formData.data.productionExceedReceiveSkuList = [];
       }
     });
   } else {
-    formData.data.productionCostList = [];
+    formData.data.productionExceedReceiveSkuList = [];
   }
 };
 </script>

+ 316 - 0
src/views/production/operation/production-error/index.vue

@@ -0,0 +1,316 @@
+<template>
+  <el-card class="box-card">
+    <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
+      <template #orderId>
+        <div style="width: 100%">
+          <el-select-v2
+            v-model="formData.data.orderId"
+            :options="productionOrder"
+            placeholder="请选择订单号"
+            @change="changeOrder()"
+            style="width: 100%"
+            filterable />
+        </div>
+      </template>
+      <template #productionExceedReceiveSkuList>
+        <div style="width: 100%">
+          <el-table :data="formData.data.productionExceedReceiveSkuList" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
+            <el-table-column label="SKU品号" prop="code" width="160" />
+            <el-table-column label="SKU品名" prop="name" min-width="220" />
+            <el-table-column label="生产错误SKU" width="200">
+              <template #default="{ row, $index }">
+                <el-button
+                  v-if="!row.exceptionSkuSpecId"
+                  type="primary"
+                  size="small"
+                  @click="handleOpen($index)"
+                  style="margin: 5px 0; background-color: #43b214; border-color: #43b214">
+                  选择SKU
+                </el-button>
+                <div style="width: 100%; display: flex; align-items: center" v-else>
+                  <el-icon style="font-size: 16px; cursor: pointer" @click="clickRemove($index)"><Remove /></el-icon>
+                  <span>{{ row.exceptionSkuSpecCode }}</span>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="仓库" width="160">
+              <template #default="{ row, $index }">
+                <el-form-item :prop="'productionExceedReceiveSkuList.' + $index + '.warehouseId'" style="width: 100%">
+                  <el-select v-model="row.warehouseId" placeholder="请选择仓库" clearable style="width: 100%">
+                    <el-option v-for="item in warehouseList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
+                  </el-select>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column label="订单数量" prop="orderQuantity" width="120" />
+            <el-table-column label="超领数量" width="160">
+              <template #default="{ row, $index }">
+                <el-form-item :prop="'productionExceedReceiveSkuList.' + $index + '.quantity'" :inline-message="true" style="width: 100%" @change="queryBOM">
+                  <el-input-number
+                    onmousewheel="return false;"
+                    v-model="row.quantity"
+                    placeholder="超领数量"
+                    style="width: 100%"
+                    :controls="false"
+                    :min="0"
+                    :precision="0"
+                    :max="row.orderQuantity" />
+                </el-form-item>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </template>
+      <template #productionExceedReceiveBomList>
+        <div style="width: 100%">
+          <el-table :data="formData.data.productionExceedReceiveBomList" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
+            <el-table-column label="BOM品号" prop="bomSpecCode" width="160" />
+            <el-table-column label="BOM品名" prop="bomSpecName" min-width="220" />
+            <el-table-column label="仓库" prop="warehouseName" width="160" />
+            <el-table-column label="库存数量" prop="inventoryQuantity" width="120" />
+            <el-table-column label="出库数量" prop="outQuantity" width="120" />
+          </el-table>
+        </div>
+      </template>
+    </byForm>
+    <div style="text-align: center; margin: 10px">
+      <el-button @click="clickCancel()" size="large">重 置</el-button>
+      <el-button type="primary" @click="submitForm()" size="large" v-preReClick>提 交</el-button>
+    </div>
+
+    <el-dialog title="选择SKU" v-if="openSKU" v-model="openSKU" width="84%">
+      <SelectProduct :selectStatus="true" :type="'null'" @selectProduct="selectProduct"></SelectProduct>
+      <template #footer>
+        <el-button @click="openSKU = false" size="large">关 闭</el-button>
+      </template>
+    </el-dialog>
+  </el-card>
+</template>
+
+<script setup>
+import byForm from "/src/components/byForm/index";
+import { ElMessage } from "element-plus";
+import SelectProduct from "/src/views/group/product/management/index";
+
+const { proxy } = getCurrentInstance();
+const productionOrder = ref([]);
+const warehouseList = ref([]);
+const typeList = ref([
+  {
+    dictKey: 1,
+    dictValue: "制作损坏",
+  },
+  {
+    dictKey: 2,
+    dictValue: "裸垫质量不良",
+  },
+  {
+    dictKey: 3,
+    dictValue: "生产错误",
+  },
+]);
+const getDemandData = () => {
+  proxy.post("/productionOrder/page", { pageNum: 1, pageSize: 9999, status: "30" }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      productionOrder.value = productionOrder.value.concat(
+        res.rows.map((item) => {
+          if (item.wlnCode) {
+            return {
+              value: item.orderId,
+              label: item.code + " (" + item.wlnCode + ")",
+            };
+          } else {
+            return {
+              value: item.orderId,
+              label: item.code,
+            };
+          }
+        })
+      );
+    }
+  });
+  proxy.post("/warehouse/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      warehouseList.value = res.rows
+        .filter((item) => ["1", "5"].includes(item.type))
+        .map((item) => {
+          return {
+            dictKey: item.id,
+            dictValue: item.name,
+          };
+        });
+    }
+  });
+};
+getDemandData();
+const submit = ref(null);
+const formOption = reactive({
+  inline: true,
+  labelWidth: "120px",
+  itemWidth: 100,
+  rules: [],
+  labelPosition: "right",
+});
+const formData = reactive({
+  data: {
+    orderId: "",
+    type: 3,
+    productionExceedReceiveSkuList: [],
+    productionExceedReceiveBomList: [],
+  },
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "slot",
+      label: "订单号",
+      slotName: "orderId",
+      prop: "orderId",
+      itemWidth: 51,
+    },
+    {
+      type: "select",
+      label: "超领原因",
+      prop: "type",
+      data: typeList.value,
+      itemWidth: 51,
+      disabled: true,
+    },
+    {
+      type: "input",
+      label: "责任人",
+      prop: "responsible",
+      itemWidth: 51,
+    },
+    {
+      type: "slot",
+      slotName: "productionExceedReceiveSkuList",
+      label: "订单商品",
+    },
+    {
+      type: "slot",
+      slotName: "productionExceedReceiveBomList",
+      label: "BOM明细",
+    },
+  ];
+});
+const rules = ref({
+  orderId: [{ required: true, message: "请选择订单号", trigger: "change" }],
+  type: [{ required: true, message: "请选择超领原因", trigger: "change" }],
+  responsible: [{ required: true, message: "请输入责任人", trigger: "blur" }],
+});
+const submitForm = () => {
+  submit.value.handleSubmit(() => {
+    if (formData.data.productionExceedReceiveSkuList && formData.data.productionExceedReceiveSkuList.length > 0) {
+      let list = formData.data.productionExceedReceiveSkuList.filter((item) => item.quantity > 0);
+      if (list && list.length > 0) {
+        for (let i = 0; i < list.length; i++) {
+          if (!list[i].exceptionSkuSpecId) {
+            return ElMessage("请选择生产错误SKU");
+          }
+          if (!list[i].warehouseId) {
+            return ElMessage("请选择仓库");
+          }
+        }
+        proxy.post("/productionExceedReceive/errorExceedReceive", formData.data).then(() => {
+          ElMessage({ message: "操作完成", type: "success" });
+          clickCancel();
+        });
+      } else {
+        return ElMessage("请输入超领数量");
+      }
+    } else {
+      return ElMessage("请添加订单商品");
+    }
+  });
+};
+const clickCancel = () => {
+  formData.data = {
+    type: 3,
+    productionExceedReceiveSkuList: [],
+    productionExceedReceiveBomList: [],
+  };
+  submit.value.resetFields();
+};
+const changeOrder = () => {
+  if (formData.data.orderId) {
+    proxy.post("/productionExceedReceive/getOrderSkuList", { id: formData.data.orderId }).then((res) => {
+      if (res && res.length > 0) {
+        formData.data.productionExceedReceiveSkuList = res.map((item) => {
+          return {
+            name: item.name,
+            code: item.code,
+            orderQuantity: item.quantity,
+            orderSkuId: item.skuId,
+            skuSpecId: item.skuSpecId,
+            exceptionSkuSpecId: "",
+            exceptionSkuSpecCode: "",
+            quantity: 0,
+            warehouseId: "",
+          };
+        });
+      } else {
+        formData.data.productionExceedReceiveSkuList = [];
+      }
+    });
+  } else {
+    formData.data.productionExceedReceiveSkuList = [];
+  }
+  formData.data.productionExceedReceiveBomList = [];
+};
+const rowIndex = ref(null);
+const openSKU = ref(false);
+const handleOpen = (index) => {
+  rowIndex.value = index;
+  openSKU.value = true;
+};
+const clickRemove = (index) => {
+  formData.data.productionExceedReceiveSkuList[index].exceptionSkuSpecId = "";
+  formData.data.productionExceedReceiveSkuList[index].exceptionSkuSpecCode = "";
+  queryBOM();
+};
+const selectProduct = (item) => {
+  if (item.id) {
+    formData.data.productionExceedReceiveSkuList[rowIndex.value].exceptionSkuSpecId = item.id;
+    formData.data.productionExceedReceiveSkuList[rowIndex.value].exceptionSkuSpecCode = item.code;
+    ElMessage({ message: "选择完成", type: "success" });
+    openSKU.value = false;
+    queryBOM();
+  }
+};
+const queryBOM = () => {
+  let list = formData.data.productionExceedReceiveSkuList.filter((item) => item.quantity > 0 && item.exceptionSkuSpecId);
+  if (list && list.length > 0) {
+    proxy
+      .post("/productionExceedReceive/getSkuSpecMaterialList", {
+        skuSpecList: list.map((item) => {
+          return {
+            skuSpecId: item.exceptionSkuSpecId,
+            quantity: item.quantity,
+          };
+        }),
+      })
+      .then(
+        (res) => {
+          formData.data.productionExceedReceiveBomList = res;
+        },
+        (err) => {
+          console.log(err);
+          formData.data.productionExceedReceiveBomList = [];
+        }
+      );
+  } else {
+    formData.data.productionExceedReceiveBomList = [];
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+:deep(.el-dialog) {
+  margin-top: 10px !important;
+  margin-bottom: 10px !important;
+}
+</style>

+ 2 - 1
src/views/production/warehouse/check/index.vue

@@ -67,6 +67,7 @@
 
 <script setup>
 import byTable from "/src/components/byTable/index";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const activeName = ref("first");
@@ -437,7 +438,7 @@ const clickSubmit = () => {
   proxy.$refs.derive.validate((valid) => {
     if (valid) {
       proxy.postFile("/check/inventoryExportExcel", { id: formData.data.warehouseId }).then((res) => {
-        proxy.downloadFile(res, "盘点.xlsx");
+        proxy.downloadFile(res, "盘点-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     }
   });

+ 76 - 72
src/views/production/warehouse/finished-parts-storage/index.vue

@@ -1,51 +1,55 @@
 <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
-            :action-list="[
-              {
-                text: '导出Excel',
-                action: () => deriveExcel(),
-              },
-            ]"
-            @get-list="getList"
-            @clickReset="clickReset">
-          </byTable>
-        </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: '导出Excel',
-                action: () => deriveExcelTwo(),
-              },
-            ]"
-            @get-list="getListTwo"
-            @clickReset="clickResetTwo">
-          </byTable>
-        </el-tab-pane>
-      </el-tabs>
-    </el-card>
-  </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">
+        </byTable>
+      </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: '导出Excel',
+              action: () => clickGiveaway(),
+            },
+          ]"
+          @get-list="getListTwo"
+          @clickReset="clickResetTwo">
+        </byTable>
+      </el-tab-pane>
+    </el-tabs>
+
+    <el-dialog title="上传" v-if="openGiveaway" v-model="openGiveaway" width="600">
+      <div v-loading="loadingGiveaway">
+        <el-upload :show-file-list="false" action="##" :http-request="giveawayServerLog" :before-upload="handleBeforeGiveaway">
+          <el-button style="background: #20b2aa; color: #fff; border: 1px solid #20b2aa">上传</el-button>
+        </el-upload>
+        <div style="text-align: center; margin: 10px">
+          <el-button @click="openGiveaway = false" size="large">关 闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </el-card>
 </template>
 
 <script setup>
 import byTable from "/src/components/byTable/index";
-import { ElMessageBox } from "element-plus";
+import { ElMessage, ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const activeName = ref("first");
@@ -149,7 +153,7 @@ const configTwo = computed(() => {
       attrs: {
         label: "订单号",
         prop: "orderCode",
-        width: 160,
+        width: 200,
       },
     },
     {
@@ -163,14 +167,14 @@ const configTwo = computed(() => {
       attrs: {
         label: "事业部",
         prop: "departmentName",
-        width: 140,
+        width: 120,
       },
     },
     {
       attrs: {
         label: "SKU品号",
         prop: "skuSpecCode",
-        width: 140,
+        width: 160,
       },
     },
     {
@@ -183,14 +187,14 @@ const configTwo = computed(() => {
       attrs: {
         label: "数量",
         prop: "quantity",
-        width: 120,
+        width: 100,
       },
     },
     {
       attrs: {
         label: "操作类型",
         prop: "operationType",
-        width: 120,
+        width: 100,
       },
       render(val) {
         if (val == "1") {
@@ -275,31 +279,31 @@ const changeActiveName = (val) => {
     getListTwo();
   }
 };
-const deriveExcel = () => {
-  ElMessageBox.confirm("你是否确认此操作", "提示", {
-    confirmButtonText: "确定",
-    cancelButtonText: "取消",
-    type: "warning",
-  })
-    .then(() => {
-      proxy.getFile("/inventoryFinished/excelExport", sourceList.value.pagination).then((res) => {
-        proxy.downloadFile(res, "成品库.xlsx");
-      });
-    })
-    .catch(() => {});
+const openGiveaway = ref(false);
+const loadingGiveaway = ref(false);
+const clickGiveaway = () => {
+  loadingGiveaway.value = false;
+  openGiveaway.value = true;
+};
+const handleBeforeGiveaway = () => {
+  loadingGiveaway.value = true;
 };
-const deriveExcelTwo = () => {
-  ElMessageBox.confirm("你是否确认此操作", "提示", {
-    confirmButtonText: "确定",
-    cancelButtonText: "取消",
-    type: "warning",
-  })
-    .then(() => {
-      proxy.getFile("/inventoryFinishedOrder/excelExport", sourceListTwo.value.pagination).then((res) => {
-        proxy.downloadFile(res, "成品库明细.xlsx");
-      });
-    })
-    .catch(() => {});
+const giveawayServerLog = (params) => {
+  let file = params.file;
+  let formFile = new FormData();
+  formFile.append("file", file);
+  proxy.postUploadAndDownloadFile("/inventoryFinishedOrder/erpExcelExport", formFile).then(
+    (res) => {
+      ElMessage({ message: "操作成功", type: "success" });
+      proxy.downloadFile(res, "成品库明细-" + moment().format("yyyy-MM-DD") + ".xlsx");
+      loadingGiveaway.value = false;
+      openGiveaway.value = false;
+    },
+    (err) => {
+      console.log(err);
+      loadingGiveaway.value = false;
+    }
+  );
 };
 </script>
 

+ 3 - 2
src/views/production/warehouse/flow-record/index.vue

@@ -22,6 +22,7 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
@@ -182,7 +183,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作时间",
-        prop: "createTime",
+        prop: "inOutStorageTime",
         width: 160,
         align: "center",
       },
@@ -252,7 +253,7 @@ const deriveExcel = () => {
   })
     .then(() => {
       proxy.postFile("/inOutStorageBom/exportExcelSummary", sourceList.value.pagination).then((res) => {
-        proxy.downloadFile(res, "出入库流水.xlsx");
+        proxy.downloadFile(res, "出入库流水-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     })
     .catch(() => {});

+ 3 - 2
src/views/production/warehouse/inventory/index.vue

@@ -56,6 +56,7 @@ import byTable from "/src/components/byTable/index";
 import { useRoute } from "vue-router";
 import useTagsViewStore from "/src/store/modules/tagsView";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const props = defineProps({
@@ -390,11 +391,11 @@ const deriveExcel = () => {
     .then(() => {
       if (route.query && route.query.backupDate) {
         proxy.getFile("/inventory/exportBackExcel", sourceList.value.pagination).then((res) => {
-          proxy.downloadFile(res, "库存.xlsx");
+          proxy.downloadFile(res, "库存-" + moment().format("yyyy-MM-DD") + ".xlsx");
         });
       } else {
         proxy.getFile("/inventory/exportExcel", sourceList.value.pagination).then((res) => {
-          proxy.downloadFile(res, "库存.xlsx");
+          proxy.downloadFile(res, "库存-" + moment().format("yyyy-MM-DD") + ".xlsx");
         });
       }
     })

+ 4 - 3
src/views/production/warehouse/outbound/index.vue

@@ -63,6 +63,7 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const activeName = ref("first");
@@ -235,7 +236,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "出库时间",
-        prop: "createTime",
+        prop: "inOutStorageTime",
         width: 160,
         align: "center",
       },
@@ -331,7 +332,7 @@ const configTwo = computed(() => {
     {
       attrs: {
         label: "出库时间",
-        prop: "createTime",
+        prop: "inOutStorageTime",
         width: 160,
         align: "center",
       },
@@ -449,7 +450,7 @@ const deriveExcel = () => {
   })
     .then(() => {
       proxy.postFile("/inOutStorageBom/exportExcel", sourceListTwo.value.pagination).then((res) => {
-        proxy.downloadFile(res, "出库明细.xlsx");
+        proxy.downloadFile(res, "出库明细-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     })
     .catch(() => {});

+ 35 - 113
src/views/production/warehouse/purchase-stock-pending/add.vue

@@ -8,12 +8,12 @@
       highlight-current-row
       :action-list="[
         {
-          text: '导入到货单',
+          text: '导入采购到货单',
           action: () => clickUpload(),
         },
         {
-          text: '新增采购入库',
-          action: () => clickAdd(),
+          text: '导入采购赠品',
+          action: () => clickGiveaway(),
         },
       ]">
       <template #dimension="{ item }">
@@ -25,7 +25,7 @@
       <el-button type="primary" @click="submitForm()" size="large" v-preReClick>确认并入库</el-button>
     </div>
 
-    <el-dialog title="导入到货单" v-if="openUpload" v-model="openUpload" width="600">
+    <el-dialog title="导入采购到货单" v-if="openUpload" v-model="openUpload" width="600">
       <div v-loading="loadingUpload">
         <el-upload :show-file-list="false" action="##" :http-request="uploadServerLog" :before-upload="handleBeforeUpload">
           <el-button style="background: #20b2aa; color: #fff; border: 1px solid #20b2aa">上传</el-button>
@@ -36,48 +36,14 @@
       </div>
     </el-dialog>
 
-    <el-dialog title="新增采购入库" v-if="openAdd" v-model="openAdd" width="80%">
-      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formDataTwo.data" :rules="rules" ref="submit">
-        <template #purchaseId>
-          <div style="width: 100%">
-            <el-select v-model="formDataTwo.data.purchaseId" placeholder="采购合同" @change="changePurchase()">
-              <el-option v-for="item in purchaseList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
-            </el-select>
-          </div>
-        </template>
-        <template #list>
-          <div style="width: 100%">
-            <el-table :data="formDataTwo.data.list" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
-              <el-table-column label="品号" prop="bomSpecCode" width="140" />
-              <el-table-column label="品名" prop="bomSpecName" min-width="220" />
-              <el-table-column label="采购数量" prop="purchaseQuantity" width="100" />
-              <el-table-column label="可入库数量" prop="canInStorageQuantity" width="100" />
-              <el-table-column label="到货数量" width="120">
-                <template #default="{ row, $index }">
-                  <el-form-item :prop="'list.' + $index + '.arrivalQuantity'" :rules="rules.arrivalQuantity" :inline-message="true" style="width: 100%">
-                    <el-input-number
-                      onmousewheel="return false;"
-                      v-model="row.arrivalQuantity"
-                      placeholder="数量"
-                      style="width: 100%"
-                      :controls="false"
-                      :min="0"
-                      :max="row.canInStorageQuantity" />
-                  </el-form-item>
-                </template>
-              </el-table-column>
-              <el-table-column label="操作" align="center" fixed="right" width="60">
-                <template #default="{ $index }">
-                  <el-button type="danger" @click="clickDelete($index)" text>删除</el-button>
-                </template>
-              </el-table-column>
-            </el-table>
-          </div>
-        </template>
-      </byForm>
-      <div style="text-align: center; margin: 10px">
-        <el-button @click="openAdd = false" size="large">关 闭</el-button>
-        <el-button type="primary" @click="submitAddForm()" size="large" v-preReClick>确 认</el-button>
+    <el-dialog title="导入采购赠品" v-if="openGiveaway" v-model="openGiveaway" width="600">
+      <div v-loading="loadingGiveaway">
+        <el-upload :show-file-list="false" action="##" :http-request="giveawayServerLog" :before-upload="handleBeforeGiveaway">
+          <el-button style="background: #20b2aa; color: #fff; border: 1px solid #20b2aa">上传</el-button>
+        </el-upload>
+        <div style="text-align: center; margin: 10px">
+          <el-button @click="openGiveaway = false" size="large">关 闭</el-button>
+        </div>
       </div>
     </el-dialog>
   </div>
@@ -85,7 +51,6 @@
 
 <script setup>
 import byTable from "/src/components/byTable/index";
-import byForm from "/src/components/byForm/index";
 import { ElMessage } from "element-plus";
 
 const { proxy } = getCurrentInstance();
@@ -93,8 +58,6 @@ const loading = ref(false);
 const purchaseList = ref([]);
 const formData = reactive({
   data: {
-    purchaseId: "",
-    arrivalCode: "",
     purchasePendingStorageBomList: [],
   },
 });
@@ -214,7 +177,7 @@ const uploadServerLog = (params) => {
   proxy.postUploadFile("/purchasePendingStorage/purchaseArrivalImport", formFile).then(
     (res) => {
       ElMessage({ message: "导入成功", type: "success" });
-      formData.data = res.data;
+      formData.data.purchasePendingStorageBomList = res.data;
       loadingUpload.value = false;
       openUpload.value = false;
     },
@@ -224,72 +187,31 @@ const uploadServerLog = (params) => {
     }
   );
 };
-const formOption = reactive({
-  inline: true,
-  labelWidth: "120px",
-  itemWidth: 100,
-  rules: [],
-  labelPosition: "right",
-  disabled: false,
-});
-const formConfig = computed(() => {
-  return [
-    {
-      type: "slot",
-      prop: "purchaseId",
-      slotName: "purchaseId",
-      label: "采购合同",
-      itemWidth: 50,
-    },
-    {
-      type: "slot",
-      slotName: "list",
-      label: "",
-    },
-  ];
-});
-const rules = ref({
-  purchaseId: [{ required: true, message: "请选择采购合同", trigger: "change" }],
-  arrivalQuantity: [{ required: true, message: "请输入数量", trigger: "change" }],
-});
-const openAdd = ref(false);
-const formDataTwo = reactive({
-  data: {
-    purchaseId: "",
-    arrivalCode: "",
-    list: [],
-  },
-});
-const submit = ref("");
-const clickAdd = () => {
-  formDataTwo.data = {
-    purchaseId: "",
-    arrivalCode: "",
-    list: [],
-  };
-  openAdd.value = true;
-};
-const changePurchase = () => {
-  formDataTwo.data.list = [];
-  proxy.post("/purchaseReturn/getPurchaseBomPage", { id: formDataTwo.data.purchaseId }).then((res) => {
-    formDataTwo.data.list = res;
-  });
+const openGiveaway = ref(false);
+const loadingGiveaway = ref(false);
+const clickGiveaway = () => {
+  loadingGiveaway.value = false;
+  openGiveaway.value = true;
 };
-const clickDelete = (index) => {
-  formDataTwo.data.list.splice(index, 1);
+const handleBeforeGiveaway = () => {
+  loadingGiveaway.value = true;
 };
-const submitAddForm = () => {
-  submit.value.handleSubmit(() => {
-    let list = formDataTwo.data.list.filter((item) => item.arrivalQuantity > 0);
-    if (list && list.length > 0) {
-      formData.data.purchaseId = formDataTwo.data.purchaseId;
-      formData.data.purchasePendingStorageBomList = formDataTwo.data.list;
-      ElMessage({ message: "添加成功", type: "success" });
-      openAdd.value = "";
-    } else {
-      return ElMessage("请添加入库清单");
+const giveawayServerLog = (params) => {
+  let file = params.file;
+  let formFile = new FormData();
+  formFile.append("file", file);
+  proxy.postUploadFile("/purchasePendingStorage/purchaseGiftImport", formFile).then(
+    (res) => {
+      ElMessage({ message: "导入成功", type: "success" });
+      formData.data.purchasePendingStorageBomList = res.data;
+      loadingGiveaway.value = false;
+      openGiveaway.value = false;
+    },
+    (err) => {
+      console.log(err);
+      loadingGiveaway.value = false;
     }
-  });
+  );
 };
 </script>
 

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

@@ -11,10 +11,12 @@
             :searchConfig="searchConfig"
             highlight-current-row
             :action-list="[
-              {
-                text: '入库登记',
-                action: () => clickModal(),
-              },
+              judgeUser()
+                ? {
+                    text: '入库登记',
+                    action: () => clickModal(),
+                  }
+                : {},
             ]"
             @get-list="getList"
             @clickReset="clickReset">
@@ -34,10 +36,12 @@
             :searchConfig="searchConfigTwo"
             highlight-current-row
             :action-list="[
-              {
-                text: '入库登记',
-                action: () => clickModal(),
-              },
+              judgeUser()
+                ? {
+                    text: '入库登记',
+                    action: () => clickModal(),
+                  }
+                : {},
               {
                 text: '导出Excel',
                 action: () => deriveExcel(),
@@ -55,6 +59,7 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const activeName = ref("first");
@@ -226,7 +231,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "入库时间",
-        prop: "createTime",
+        prop: "inOutStorageTime",
         width: 160,
         align: "center",
       },
@@ -322,7 +327,7 @@ const configTwo = computed(() => {
     {
       attrs: {
         label: "入库时间",
-        prop: "createTime",
+        prop: "inOutStorageTime",
         width: 160,
         align: "center",
       },
@@ -432,11 +437,14 @@ const deriveExcel = () => {
   })
     .then(() => {
       proxy.postFile("/inOutStorageBom/exportExcel", sourceListTwo.value.pagination).then((res) => {
-        proxy.downloadFile(res, "入库明细.xlsx");
+        proxy.downloadFile(res, "入库明细-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     })
     .catch(() => {});
 };
+const judgeUser = () => {
+  return proxy.useUserStore().user.userId === "1";
+};
 </script>
 
 <style lang="scss" scoped>

+ 18 - 10
src/views/subsidiary/order/management/add.vue

@@ -1278,17 +1278,25 @@ const clickSaveShippingPackage = () => {
         formData.data.deliveryMaterialsFee = computeDeliveryMaterialsFee();
         formData.data.totalAmount = calculatedTotalAmount();
         let type = "add";
-        if (formData.data.id) {
-          type = "edit";
-        }
-        proxy.post("/orderInfo/" + type, formData.data).then(() => {
-          ElMessage({
-            message: type == "add" ? "添加成功" : "编辑成功",
-            type: "success",
+        if (formData.data.id && status == "20") {
+          proxy.post("/orderInfo/confirmation", formData.data).then(() => {
+            ElMessage({ message: "提交成功", type: "success" });
+            refreshStore().setRefresh("order");
+            clickCancel();
           });
-          refreshStore().setRefresh("order");
-          clickCancel();
-        });
+        } else {
+          if (formData.data.id) {
+            type = "edit";
+          }
+          proxy.post("/orderInfo/" + type, formData.data).then(() => {
+            ElMessage({
+              message: type == "add" ? "添加成功" : "编辑成功",
+              type: "success",
+            });
+            refreshStore().setRefresh("order");
+            clickCancel();
+          });
+        }
       } else {
         ElMessageBox.confirm("是否确认无产品发货包装", "提示", {
           confirmButtonText: "确定",

+ 0 - 11
src/views/subsidiary/order/management/index.vue

@@ -252,17 +252,6 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "外箱包装费 ¥",
-        prop: "outerBoxPackingFee",
-        width: 120,
-        align: "right",
-      },
-      render(val) {
-        return proxy.moneyFormat(val);
-      },
-    },
-    {
-      attrs: {
         label: "交期",
         prop: "deliveryTime",
         width: 160,

+ 0 - 11
src/views/subsidiary/order/productManagement/index.vue

@@ -269,17 +269,6 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "外箱包装费 ¥",
-        prop: "outerBoxPackingFee",
-        width: 120,
-        align: "right",
-      },
-      render(val) {
-        return proxy.moneyFormat(val);
-      },
-    },
-    {
-      attrs: {
         label: "下单时间",
         slot: "wlnCreateTime",
         width: 160,

+ 2 - 1
src/views/subsidiary/warehouse/inventory/index.vue

@@ -54,6 +54,7 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const departmentList = ref([]);
@@ -312,7 +313,7 @@ const deriveExcel = () => {
   })
     .then(() => {
       proxy.getFile("/inventory/exportExcel", sourceList.value.pagination).then((res) => {
-        proxy.downloadFile(res, "库存.xlsx");
+        proxy.downloadFile(res, "库存-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     })
     .catch(() => {});