Browse Source

Merge branch 'master' of http://192.168.1.160:3000/zhaohanlin/rtk-web-wms-cloud

yesheng 1 month ago
parent
commit
dcab99779d

+ 30 - 23
src/api/common/index.js

@@ -1,37 +1,44 @@
-import request from '@/utils/request'
-const baseURL = 'http://127.0.0.1:9000'
+import request from "@/utils/request";
+const baseURL = "http://127.0.0.1:9000";
 
 // 查询地理位置
-export function fetchAreaList (query) {
+export function fetchAreaList(query) {
   return request({
-    url: '/mes/factory/areainfos',
-    method: 'get',
-    params: query
-  })
+    url: "/mes/factory/areainfos",
+    method: "get",
+    params: query,
+  });
 }
 
 // 删除附件
-export function deleteFileList (id) {
+export function deleteFileList(id) {
   return request({
-    url: '/minio/files/deleteFileList/' + id,
-    method: 'delete',
-  })
+    url: "/minio/files/deleteFileList/" + id,
+    method: "delete",
+  });
 }
-export function getExportPdf (data) {
+export function getExportPdf(data) {
   return request({
-    url: 'http://192.168.1.94:48080/jmreport/exportPdf',
-    method: 'post',
+    url: "http://192.168.1.94:48080/jmreport/exportPdf",
+    method: "post",
     headers: { isToken: false },
-    data: data
-  })
+    data: data,
+  });
 }
 
-
+// 查询过滤条件
+export function getFilterListInQuery(data) {
+  return request({
+    url: "/infra/query-manage/filterList",
+    method: "post",
+    data: data,
+  });
+}
 // 标签打印-通用(bartender)
-export function printLabel (data) {
+export function printLabel(data) {
   return request({
-    method: 'post',
-    url: baseURL + '/commonPrint',
-    data
-  })
-}
+    method: "post",
+    url: baseURL + "/commonPrint",
+    data,
+  });
+}

+ 7 - 0
src/api/wms/output/inrequest.js

@@ -65,6 +65,13 @@ export function getStockPage(params) {
         params,
     });
 }
+export function getMaterialPage(params) {
+    return request({
+        url: "/rtkerp/material/page",
+        method: "get",
+        params,
+    });
+}
 // 获得入库申请主分页
 export function getInRequestPage(params) {
     return request({

+ 14 - 4
src/views/mes/queryManage/components/FilterColumnInQuery.vue

@@ -57,6 +57,7 @@
     <!-- 多选列表 -->
     <div v-else class="mb5" style="max-height: 350px; overflow: auto">
       <el-table
+        ref="multipleTable"
         :data="filteredList"
         size="mini"
         height="350"
@@ -162,6 +163,7 @@ export default {
   methods: {
     /* ---- 生命周期 ---- */
     async onPopoverShow() {
+      console.log("onPopoverShow被调用");
       this.$nextTick(() => this.$refs.seachRef?.focus());
       if (this.isFirstLoad || this.searchKey) {
         await this.fetchFilterListInQueryManage(true);
@@ -192,6 +194,10 @@ export default {
 
     /* ---- 数据获取 ---- */
     async fetchFilterListInQueryManage(reload) {
+      console.log(
+        "fetchFilterListInQueryManage被调用,htmlType:",
+        this.htmlType
+      );
       if (["datetime", "daterange"].includes(this.htmlType)) return;
       try {
         this.loading = true;
@@ -205,8 +211,12 @@ export default {
             params[k] = this.activeFilters[k].map((i) => i.column).join(",");
           }
         });
+        console.log("调用getFilterListInQuery,参数:", params);
         const { data } = await getFilterListInQuery(params);
         this.filterData = data || [];
+        console.log("获取筛选数据成功,filterData:", this.filterData);
+      } catch (error) {
+        console.error("获取筛选数据失败:", error);
       } finally {
         this.loading = false;
       }
@@ -269,16 +279,16 @@ export default {
     dateChange(val) {
       this.currentRows = [
         {
-          column: formatDateTimeRange(val),
+          column: this.formatDateTimeRange(val),
           isRange: true,
-          rawData: { [this.prop]: formatDateTimeRange(val) },
+          rawData: { [this.prop]: this.formatDateTimeRange(val) },
         },
       ];
     },
 
     /* ---- 按钮 ---- */
     filterConfirm() {
-      this.$emit("selectData", this.currentRows, this.prop, this.htmlType);
+      this.$emit("select-data", this.currentRows, this.prop, this.htmlType);
       this.$refs.popover.doClose();
     },
     filterCancel(flag) {
@@ -286,7 +296,7 @@ export default {
       this.dateRangeValue = "";
       this.currentRows = [];
       if (!flag) {
-        this.$emit("selectData", [], this.prop, this.htmlType);
+        this.$emit("select-data", [], this.prop, this.htmlType);
         this.$refs.popover.doClose();
         this.isFirstLoad = true;
       }

+ 2 - 2
src/views/mes/queryManage/query.vue

@@ -438,8 +438,8 @@ export default {
     // 获取显隐列列表
     this.id = this.$route.query?.id;
     this.getQueryData();
-    //昱懋的,应该用不上
-    /*QueryManageApi.queryManageExecutecomplexdropdownlist().then((res) => {
+    // 昱懋的,应该用不上
+    /* QueryManageApi.queryManageExecutecomplexdropdownlist().then((res) => {
       this.dropdownList = res;
     });*/
   },

+ 18 - 3
src/views/mes/queryManage/queryNew.vue

@@ -197,7 +197,6 @@
 </template>
 
 <script>
-/* --------------  以下为 script,仅把 ContentWrap 的 props 拿过来  -------------- */
 import * as QueryManageApi from "@/api/mes/queryManage";
 import { getQueryManageButtonPage } from "@/api/mes/queryManage/button";
 import { saveAs } from "file-saver";
@@ -306,20 +305,30 @@ export default {
     },
 
     async getList() {
+      console.log("getList被调用,queryParamList:", this.queryParamList);
       try {
+        this.loading = true;
+        console.log("调用QueryManageApi.loadTableData,参数:", {
+          pageNo: this.pageNo,
+          pageSize: this.pageSize,
+          paramList: this.queryParamList,
+          id: this.$route.query?.id,
+        });
         const data = await QueryManageApi.loadTableData({
           pageNo: this.pageNo,
           pageSize: this.pageSize,
           paramList: this.queryParamList,
           id: this.$route.query?.id,
         });
-        console.log("后端返回", data); // ← 看这里
+        console.log("后端返回", data);
         this.list = data?.data?.list || [];
         console.log("赋值后 list =", this.list);
         console.log("list.length =", this.list.length);
         console.log("list 第一条 =", this.list[0]);
         this.originalList = JSON.parse(JSON.stringify(data?.data?.list || []));
         this.total = data?.data?.total || 0;
+      } catch (error) {
+        console.error("getList错误:", error);
       } finally {
         this.loading = false;
       }
@@ -559,6 +568,7 @@ export default {
     },
 
     filterData(data, field, type, row) {
+      console.log("filterData被调用:", { data, field, type, row });
       const { dataType } = row;
       this.$set(this.customFilters, field, data);
       const isDateRange = data[0]?.isRange;
@@ -575,6 +585,10 @@ export default {
             value: valueList,
           });
         }
+        console.log(
+          "filterData - 日期范围筛选后queryParamList:",
+          this.queryParamList
+        );
         this.getList();
         return;
       }
@@ -599,6 +613,7 @@ export default {
         const idx = this.queryParamList.findIndex((item) => item.key === field);
         if (idx > -1) this.queryParamList.splice(idx, 1);
       }
+      console.log("filterData - 筛选后queryParamList:", this.queryParamList);
       this.getList();
     },
 
@@ -791,7 +806,7 @@ export default {
   margin-bottom: 3px;
 }
 
-/* ---------- 原来的表格样式 ---------- */
+/* ---------- 原来的表格样式 ---------- */
 :deep(.el-table__row) {
   height: 15px !important;
 }

+ 88 - 1
src/views/rtkwms/inrequest/InRequestForm.vue

@@ -158,6 +158,13 @@
           </el-form-item>
         </el-col>
       </el-form>
+      <el-button
+        type="primary"
+        size="mini"
+        style="margin-bottom: 10px"
+        @click="add()"
+        >新增明细</el-button
+      >
       <el-table :data="formData.list" border size="mini">
         <el-table-column
           label="源单编号"
@@ -179,7 +186,28 @@
           prop="materialName"
           width="150"
           show-overflow-tooltip
-        />
+        >
+          <template v-slot="scope">
+            <el-select
+              v-model="scope.row.materialName"
+              filterable
+              remote
+              reserve-keyword
+              placeholder="请选择物料名称"
+              :remote-method="remoteMaterialName"
+              :loading="loading"
+              @change="changeMaterialName"
+            >
+              <el-option
+                v-for="item in materialNameList"
+                :key="item.code"
+                :label="item.name"
+                :value="item.code + '-' + scope.$index"
+              >
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
         <el-table-column
           label="客户编码"
           align="center"
@@ -236,6 +264,23 @@
             <el-input v-model="scope.row.remark" />
           </template>
         </el-table-column>
+        <el-table-column
+          label="操作"
+          align="center"
+          fixed="right"
+          width="150px"
+          class-name="small-padding fixed-width"
+        >
+          <template v-slot="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDelete(scope)"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
       </el-table>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" :disabled="formLoading" @click="submitForm"
@@ -257,6 +302,7 @@ export default {
   },
   data() {
     return {
+      materialNameList: [],
       sourceOrderNoList: [],
       businessDescribeList: [],
       warehouseList: [],
@@ -345,6 +391,28 @@ export default {
     };
   },
   methods: {
+    handleDelete(row) {
+      console.log(row);
+      this.formData.list.splice(row.$index, 1);
+    },
+    remoteMaterialName(query) {
+      if (query !== "") {
+        let that = this;
+        this.loading = true;
+        setTimeout(async () => {
+          this.loading = false;
+          let {
+            data: { list },
+          } = await InRequestApi.getMaterialPage({
+            name: query,
+            pageSize: 999,
+          });
+          this.materialNameList = list || [];
+        }, 200);
+      } else {
+        this.materialNameList = [];
+      }
+    },
     remoteMethod(query) {
       if (query !== "") {
         let that = this;
@@ -354,6 +422,7 @@ export default {
           let { data } = await InRequestApi.getSourceOrder({
             businessType: that.formData.businessType,
             sourceOrderNo: query,
+            pageSize: 999,
           });
           this.sourceOrderNoList = data || [];
         }, 200);
@@ -361,6 +430,14 @@ export default {
         this.sourceOrderNoList = [];
       }
     },
+    add() {
+      if (!this.formData.businessType) {
+        return this.$message.error("请先选择业务类型");
+      }
+      this.formData.list = this.formData.list || [];
+      this.formData.list.push({});
+      this.formData = { ...this.formData };
+    },
     remoteWarehouse(query) {
       if (query !== "") {
         let that = this;
@@ -386,6 +463,16 @@ export default {
         }
       });
     },
+    changeMaterialName(value) {
+      let data = value.split("-");
+      this.materialNameList.map((v) => {
+        if (v.code == data[0]) {
+          v.materialNo = v.code;
+          v.materialName = v.name;
+          this.formData.list[data[1]] = v;
+        }
+      });
+    },
     changeBusinessDescribe(e) {
       this.businessDescribeList.map((v) => {
         if (v.label == e) {

+ 87 - 1
src/views/wms/output/inrequest/components/InRequestForm.vue

@@ -158,6 +158,13 @@
           </el-form-item>
         </el-col>
       </el-form>
+      <el-button
+        type="primary"
+        size="mini"
+        style="margin-bottom: 10px"
+        @click="add()"
+        >新增明细</el-button
+      >
       <el-table :data="formData.list" border size="mini">
         <el-table-column
           label="源单编号"
@@ -179,7 +186,28 @@
           prop="materialName"
           width="150"
           show-overflow-tooltip
-        />
+        >
+          <template v-slot="scope">
+            <el-select
+              v-model="scope.row.materialName"
+              filterable
+              remote
+              reserve-keyword
+              placeholder="请选择物料名称"
+              :remote-method="remoteMaterialName"
+              :loading="loading"
+              @change="changeMaterialName"
+            >
+              <el-option
+                v-for="item in materialNameList"
+                :key="item.code"
+                :label="item.name"
+                :value="item.code + '-' + scope.$index"
+              >
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
         <el-table-column
           label="客户编码"
           align="center"
@@ -236,6 +264,23 @@
             <el-input v-model="scope.row.remark" />
           </template>
         </el-table-column>
+        <el-table-column
+          label="操作"
+          align="center"
+          fixed="right"
+          width="150px"
+          class-name="small-padding fixed-width"
+        >
+          <template v-slot="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDelete(scope)"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
       </el-table>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" :disabled="formLoading" @click="submitForm"
@@ -257,6 +302,7 @@ export default {
   },
   data() {
     return {
+      materialNameList: [],
       sourceOrderNoList: [],
       businessDescribeList: [],
       warehouseList: [],
@@ -345,6 +391,46 @@ export default {
     };
   },
   methods: {
+    handleDelete(row) {
+      console.log(row);
+      this.formData.list.splice(row.$index, 1);
+    },
+    remoteMaterialName(query) {
+      if (query !== "") {
+        let that = this;
+        this.loading = true;
+        setTimeout(async () => {
+          this.loading = false;
+          let {
+            data: { list },
+          } = await InRequestApi.getMaterialPage({
+            name: query,
+            pageSize: 999,
+          });
+          this.materialNameList = list || [];
+        }, 200);
+      } else {
+        this.materialNameList = [];
+      }
+    },
+    add() {
+      if (!this.formData.businessType) {
+        return this.$message.error("请先选择业务类型");
+      }
+      this.formData.list = this.formData.list || [];
+      this.formData.list.push({});
+      this.formData = { ...this.formData };
+    },
+    changeMaterialName(value) {
+      let data = value.split("-");
+      this.materialNameList.map((v) => {
+        if (v.code == data[0]) {
+          v.materialNo = v.code;
+          v.materialName = v.name;
+          this.formData.list[data[1]] = v;
+        }
+      });
+    },
     remoteMethod(query) {
       if (query !== "") {
         let that = this;