Browse Source

修改来料登记-录入页面

乐菲 1 week ago
parent
commit
ff70492f24

+ 2 - 2
.env.dev

@@ -5,8 +5,8 @@ NODE_ENV = 'development'
 VUE_APP_TITLE = WMS开发环境
 
 # 芋道管理系统/开发环境
-# VUE_APP_BASE_API = 'http://192.168.1.94:48080'
-VUE_APP_BASE_API = 'http://113.105.183.190:48028'
+VUE_APP_BASE_API = 'http://192.168.1.94:48080'
+# VUE_APP_BASE_API = 'http://113.105.183.190:48028'
 # VUE_APP_BASE_API = 'http://61.155.26.34:36936'
 # VUE_APP_BASE_API = 'http://127.0.0.1:48080'
 # VUE_APP_BASE_API = 'http://2227el9013.iok.la'

+ 6 - 2
.env.rtk.prod

@@ -5,10 +5,14 @@ NODE_ENV = 'development'
 VUE_APP_TITLE = 瑞泰克WMS开发环境
 
 # 芋道管理系统/开发环境
-VUE_APP_BASE_API = 'http://113.105.183.190:48028'
+# VUE_APP_BASE_API = 'http://113.105.183.190:48028'
+VUE_APP_BASE_API = 'http://113.105.183.190:15980'
+
 
 # 积木报表API
-VUE_APP_REPORT_API = 'http://113.105.183.190:48028'
+# VUE_APP_REPORT_API = 'http://113.105.183.190:48028'
+VUE_APP_REPORT_API = 'http://113.105.183.190:15980'
+
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 8 - 1
src/api/wms/orders/purchase.js

@@ -94,7 +94,14 @@ export function getDropDownList(query) {
     params: query,
   });
 }
-
+//委外收料获取源单编号
+export function getDropDownList2(query) {
+  return request({
+    url: "/rtkerp/out-source/dropDownList",
+    method: "get",
+    params: query,
+  });
+}
 // 供应商确认交期
 export function purchaseConfirmTime(data) {
   return request({

+ 21 - 1
src/views/mes/queryManage/queryNew.vue

@@ -626,10 +626,30 @@ export default {
       return item && item.dataType === "ym_int_query_type";
     },
 
+    // isDateTime(key) {
+    //   if (!Array.isArray(this.queryData)) return false;
+    //   const item = this.queryData.find((item) => item.columnComment === key);
+    //   return item && item.javaType === "LocalDateTime";
+    // },
     isDateTime(key) {
       if (!Array.isArray(this.queryData)) return false;
       const item = this.queryData.find((item) => item.columnComment === key);
-      return item && item.javaType === "LocalDateTime";
+      if (!item) return false;
+
+      // 扩展更多时间类型
+      const timeTypes = [
+        "LocalDateTime",
+        "LocalDate",
+        "LocalTime",
+        "Date",
+        "Timestamp",
+        "DateTime",
+        "java.util.Date",
+        "java.sql.Date",
+        "java.sql.Timestamp",
+      ];
+
+      return timeTypes.includes(item.javaType);
     },
 
     hasFilter(field) {

+ 25 - 1
src/views/wms/incoming/register/components/MaterialSelect.vue

@@ -56,6 +56,7 @@ export default {
       loading: false,
       options: [],
       inStockId: "",
+      outSourceId: "",
     };
   },
   computed: {
@@ -85,6 +86,22 @@ export default {
           });
       }
     },
+    outSourceId(val) {
+      if (val) {
+        const params = {
+          pageNo: 1,
+          pageSize: 100,
+          outSourceId: val,
+        };
+        getMaterialDropDownList(params)
+          .then(({ data }) => {
+            this.options = data || [];
+          })
+          .finally(() => {
+            // this.loading = false;
+          });
+      }
+    },
   },
   created() {},
   methods: {
@@ -92,12 +109,19 @@ export default {
       const val = v.trim();
       if (val && val.length > 3) {
         this.loading = true;
+        // 根据outSourceId或inStockId决定使用哪个参数
         const params = {
           pageNo: 1,
           pageSize: 100,
-          inStockId: this.inStockId,
           materialNo: val,
         };
+        // 如果outSourceId存在,使用outSourceId参数
+        if (this.outSourceId) {
+          params.outSourceId = this.outSourceId;
+        } else {
+          // 否则使用inStockId参数
+          params.inStockId = this.inStockId;
+        }
         getMaterialDropDownList(params)
           .then(({ data }) => {
             this.options = data || [];

+ 58 - 19
src/views/wms/incoming/register/materialRegistration.vue

@@ -43,7 +43,7 @@
               v-model="form.supplierCode"
               clearable
               filterable
-              :disabled="form.receiptType == '1'"
+              :disabled="form.receiptType == '1' || form.receiptType == '3'"
               @change="supplierChange"
             />
           </el-form-item>
@@ -57,13 +57,17 @@
           </el-form-item>
         </el-col>
         <el-col :span="8">
-          <el-form-item label="采购订单" prop="purchaseOrderNo">
+          <el-form-item label="源单编号" prop="purchaseOrderNo">
             <OrderSelect
               ref="purchaseOrder"
               v-model="form.purchaseOrderNo"
               clearable
-              :disabled="form.receiptType === '4' ||form.receiptType === '2'||!!materialLots"
-              placeholder="请选择采购订单"
+              :disabled="
+                form.receiptType === '4' ||
+                form.receiptType === '2' ||
+                !!materialLots
+              "
+              placeholder="请选择源单编号"
               :options="orderOptions"
               @change="OrderNoChange"
             />
@@ -363,7 +367,7 @@ import IssuePrinit from "../../output/productionIssue/issueDetails/IssuePrinit.v
 const AccessTokenKey = "ACCESS_TOKEN";
 // 供应商下拉列表
 import SupplierListSelect from "./components/SupplierListSelect.vue";
-import { getDropDownList } from "@/api/wms/orders/purchase";
+import { getDropDownList, getDropDownList2 } from "@/api/wms/orders/purchase";
 // 部门
 import DepartMentSelect from "./components/DepartMentSelect.vue";
 import AttachmentUpload from "./components/AttachmentUpload.vue";
@@ -569,8 +573,8 @@ export default {
         if (data.receiptType == 2) {
           this.otherShow = false;
         }
-        if(data.receiptType !== 1){
-          // 设置采购订单号为非必填项
+        if (data.receiptType !== 1) {
+          // 设置源单编号为非必填项
           this.$refs.form.rules.purchaseOrderNo[0].required = false;
         }
         // 补打列表
@@ -710,10 +714,12 @@ export default {
         await this.$refs.form.validate();
         this.sureLoading = true;
 
-        //取出上传的文件id
-        const files = this.uploadFiles.map((item) => {
-          return item.id || item.name?.fileId;
-        }).filter(id => id && id !== '');
+        // 取出上传的文件id
+        const files = this.uploadFiles
+          .map((item) => {
+            return item.id || item.name?.fileId;
+          })
+          .filter((id) => id && id !== "");
 
         const isAll = this.list.some(
           (item) => item.qty && item.length && item.width
@@ -842,7 +848,11 @@ export default {
         if (supplierCode) {
           this.form.supplierCode = supplierCode;
         }
-        this.$refs.materialOrder.inStockId = id;
+        if (this.form.receiptType == "3") {
+          this.$refs.materialOrder.outSourceId = id;
+        } else {
+          this.$refs.materialOrder.inStockId = id;
+        }
         // this.fetchMaterialNoList(id);
         this.materialDisabled = false;
       }
@@ -885,17 +895,33 @@ export default {
         this.receiptShow = true;
         // 显示其他相关字段
         this.otherShow = true;
-        // 如果采购订单号未定义
+        // 如果源单编号未定义
         if (this.purchaseOrderNo === undefined) {
           // 禁用物料选择
           this.materialDisabled = true;
           // 清空客户代码
           this.form.customerCode = undefined;
-          // 设置采购订单号为必填项
+          // 设置源单编号为必填项
           this.$refs.form.rules.purchaseOrderNo[0].required = true;
           // 获取订单号列表
           this.fetchOrderNoList();
         }
+      } else if (v === "3") {
+        // 显示收料单相关字段
+        this.receiptShow = true;
+        // 显示其他相关字段
+        this.otherShow = true;
+        // 如果源单编号未定义
+        if (this.purchaseOrderNo === undefined) {
+          // 禁用物料选择
+          this.materialDisabled = true;
+          // 清空客户代码
+          this.form.customerCode = undefined;
+          // 设置源单编号为必填项
+          this.$refs.form.rules.purchaseOrderNo[0].required = true;
+          // 获取订单号列表
+          this.fetchOrderNoList2();
+        }
       }
       // 收料类型为'4'(其他入库)时的处理逻辑
       else if (v === "4") {
@@ -905,18 +931,18 @@ export default {
         this.materialDisabled = false;
         // 隐藏收料单相关字段
         this.receiptShow = false;
-        // 设置采购订单号为非必填项
+        // 设置源单编号为非必填项
         this.$refs.form.rules.purchaseOrderNo[0].required = false;
         // 清空客户代码
         this.form.customerCode = undefined;
-        // 清空采购订单
+        // 清空源单编
         this.form.purchaseOrderNo = undefined;
         // 清空物料订单的入库ID
         this.$refs.materialOrder.inStockId = undefined;
       }
       // 其他收料类型的处理逻辑
       else {
-        // 设置采购订单号为非必填项
+        // 设置源单编号为非必填项
         this.$refs.form.rules.purchaseOrderNo[0].required = false;
         // 隐藏收料单相关字段
         this.receiptShow = false;
@@ -924,12 +950,13 @@ export default {
         this.otherShow = false;
         // 启用物料选择
         this.materialDisabled = false;
-        // 清空采购订单
+        // 清空源单编
         this.form.purchaseOrderNo = undefined;
         // 清空供应商代码
         this.form.supplierCode = undefined;
-        // 清空物料订单的入库ID
+        // 清空物料订单的入库ID和委外ID
         this.$refs.materialOrder.inStockId = undefined;
+        this.$refs.materialOrder.outSourceId = undefined;
       }
     },
     // 根据宽度计算每包数量
@@ -1018,6 +1045,18 @@ export default {
           this.loading = false;
         });
     },
+    fetchOrderNoList2(supplierCode) {
+      const params = {
+        supplierCode,
+      };
+      getDropDownList2(params)
+        .then((res) => {
+          this.orderOptions = res.data || [];
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
     // 附件上传
     handleUpload() {
       this.$refs.attachmentUpload.isUploadShow = -1;

+ 82 - 86
vue.config.js

@@ -1,18 +1,18 @@
-'use strict'
-const path = require('path')
-const defaultSettings = require('./src/settings.js')
+"use strict";
+const path = require("path");
+const defaultSettings = require("./src/settings.js");
 
 function resolve(dir) {
-  return path.join(__dirname, dir)
+  return path.join(__dirname, dir);
 }
 
-const CompressionPlugin = require('compression-webpack-plugin')
+const CompressionPlugin = require("compression-webpack-plugin");
 
-const name = process.env.VUE_APP_TITLE || '芋道管理系统' // 网页标题
+const name = process.env.VUE_APP_TITLE || "芋道管理系统"; // 网页标题
 
-const port = process.env.port || process.env.npm_config_port || 80 // 端口
+const port = process.env.port || process.env.npm_config_port || 80; // 端口
 
-const isProd = process.env.ENV === 'production'
+const isProd = process.env.ENV === "production";
 // vue.config.js 配置说明
 //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
 // 这里只列一部分,具体配置参考文档
@@ -20,125 +20,121 @@ module.exports = {
   // 部署生产环境和开发环境下的URL。
   // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
   // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
-  publicPath: process.env.PUBLIC_PATH ? process.env.PUBLIC_PATH : '/',
+  publicPath: process.env.PUBLIC_PATH ? process.env.PUBLIC_PATH : "/",
   // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
-  outputDir: 'dist',
+  outputDir: "dist",
   // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
-  assetsDir: 'static',
+  assetsDir: "static",
   // 是否开启eslint保存检测,有效值:ture | false | 'error'
-  lintOnSave: process.env.NODE_ENV === 'development',
+  lintOnSave: process.env.NODE_ENV === "development",
   // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
   productionSourceMap: false,
   // webpack-dev-server 相关配置
   devServer: {
-    host: '0.0.0.0',
+    host: "0.0.0.0",
     port: port,
     open: true,
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
-      ['/proxy-api']: {
+      ["/proxy-api"]: {
         target: `http://localhost:48080`,
         // target: `http://api-dashboard.yudao.iocoder.cn`,
         changeOrigin: true,
         pathRewrite: {
-          ['^' + process.env.VUE_APP_BASE_API]: ''
-        }
-      }
+          ["^" + process.env.VUE_APP_BASE_API]: "",
+        },
+      },
     },
-    disableHostCheck: true
+    disableHostCheck: true,
   },
   css: {
     loaderOptions: {
       sass: {
-        sassOptions: { outputStyle: "expanded" }
-      }
-    }
+        sassOptions: { outputStyle: "expanded" },
+      },
+    },
   },
   configureWebpack: {
     name: name,
     resolve: {
       alias: {
-        '@': resolve('src')
-      }
+        "@": resolve("src"),
+      },
     },
     plugins: [
       // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
       new CompressionPlugin({
-        cache: false,                   // 不启用文件缓存
-        test: /\.(js|css|html)?$/i,     // 压缩文件格式
-        filename: '[path].gz[query]',   // 压缩后的文件名
-        algorithm: 'gzip',              // 使用gzip压缩
-        minRatio: 0.8                   // 压缩率小于1才会压缩
-      })
+        cache: false, // 不启用文件缓存
+        test: /\.(js|css|html)?$/i, // 压缩文件格式
+        filename: "[path].gz[query]", // 压缩后的文件名
+        algorithm: "gzip", // 使用gzip压缩
+        minRatio: 0.8, // 压缩率小于1才会压缩
+      }),
     ],
   },
   chainWebpack(config) {
     // 生产环境analyzer
     if (isProd) {
-      config.plugin('webpack-bundle-analyzer')
-      .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
+      config
+        .plugin("webpack-bundle-analyzer")
+        .use(require("webpack-bundle-analyzer").BundleAnalyzerPlugin);
     }
-    config.plugins.delete('preload') // TODO: need test
-    config.plugins.delete('prefetch') // TODO: need test
+    config.plugins.delete("preload"); // TODO: need test
+    config.plugins.delete("prefetch"); // TODO: need test
 
     // set svg-sprite-loader
+    config.module.rule("svg").exclude.add(resolve("src/assets/icons")).end();
     config.module
-      .rule('svg')
-      .exclude.add(resolve('src/assets/icons'))
-      .end()
-    config.module
-      .rule('icons')
+      .rule("icons")
       .test(/\.svg$/)
-      .include.add(resolve('src/assets/icons'))
+      .include.add(resolve("src/assets/icons"))
       .end()
-      .use('svg-sprite-loader')
-      .loader('svg-sprite-loader')
+      .use("svg-sprite-loader")
+      .loader("svg-sprite-loader")
       .options({
-        symbolId: 'icon-[name]'
+        symbolId: "icon-[name]",
       })
-      .end()
+      .end();
 
-    config
-      .when(process.env.NODE_ENV !== 'development',
-        config => {
-          config
-            .plugin('ScriptExtHtmlWebpackPlugin')
-            .after('html')
-            .use('script-ext-html-webpack-plugin', [{
-            // `runtime` must same as runtimeChunk name. default is `runtime`
-              inline: /runtime\..*\.js$/
-            }])
-            .end()
-          config
-            .optimization.splitChunks({
-              chunks: 'all',
-              cacheGroups: {
-                libs: {
-                  name: 'chunk-libs',
-                  test: /[\\/]node_modules[\\/]/,
-                  priority: 10,
-                  chunks: 'initial' // only package third parties that are initially dependent
-                },
-                elementUI: {
-                  name: 'chunk-elementUI', // split elementUI into a single package
-                  priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
-                  test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
-                },
-                commons: {
-                  name: 'chunk-commons',
-                  test: resolve('src/components'), // can customize your rules
-                  minChunks: 3, //  minimum common number
-                  priority: 5,
-                  reuseExistingChunk: true
-                }
-              }
-            })
-          config.optimization.runtimeChunk('single'),
+    config.when(process.env.NODE_ENV !== "development", (config) => {
+      config
+        .plugin("ScriptExtHtmlWebpackPlugin")
+        .after("html")
+        .use("script-ext-html-webpack-plugin", [
           {
-             from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
-             to: './', //到根目录下
-          }
-        }
-      )
-  }
-}
+            // `runtime` must same as runtimeChunk name. default is `runtime`
+            inline: /runtime\..*\.js$/,
+          },
+        ])
+        .end();
+      config.optimization.splitChunks({
+        chunks: "all",
+        cacheGroups: {
+          libs: {
+            name: "chunk-libs",
+            test: /[\\/]node_modules[\\/]/,
+            priority: 10,
+            chunks: "initial", // only package third parties that are initially dependent
+          },
+          elementUI: {
+            name: "chunk-elementUI", // split elementUI into a single package
+            priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
+            test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
+          },
+          commons: {
+            name: "chunk-commons",
+            test: resolve("src/components"), // can customize your rules
+            minChunks: 3, //  minimum common number
+            priority: 5,
+            reuseExistingChunk: true,
+          },
+        },
+      });
+      config.optimization.runtimeChunk("single"),
+        {
+          from: path.resolve(__dirname, "./public/robots.txt"), //防爬虫文件
+          to: "./", //到根目录下
+        };
+    });
+  },
+};