Просмотр исходного кода

Merge remote-tracking branch 'origin/dev' into dev

hmm 5 месяцев назад
Родитель
Сommit
9ce7b7a8ae

+ 1 - 1
package.json

@@ -7,7 +7,7 @@
   "type": "module",
   "scripts": {
     "dev": "vite serve --mode development",
-    "build:prod": "vite build --mode production",
+    "build:prod": "node --max_old_space_size=8196  ./node_modules/vite/bin/vite.js build",
     "build:dev": "vite build --mode development",
     "preview": "vite preview",
     "lint:eslint": "eslint  --fix --ext .ts,.js,.vue ./src ",

+ 9 - 0
src/api/comprehensiveGuarantee/materialReserveManagement/InventoryDetails.ts

@@ -0,0 +1,9 @@
+import request from '@/utils/request';
+// 查询
+export function getMovementList(params) {
+  return request({
+    url: '/api/resource_provison/material/warehouse_movement/list',
+    method: 'get',
+    params: params
+  });
+}

+ 1 - 1
src/components/Map/YztMap/DistributionMap.vue

@@ -155,7 +155,7 @@ onUnmounted(() => {
 });
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
 .map-container {
   width: 100%;
   height: 100%;

+ 3 - 3
src/components/Map/YztMap/index.vue

@@ -67,9 +67,9 @@ watch(
   () => props.showMask,
   () => {
     if (props.showMask) {
-      mapUtils.createVecByJson(mmJson, '茂名市');
+      mapUtils.createVecByJson2(mmJson, { strokeWeight: 2 });
     } else {
-      mapUtils.removeMask2();
+      mapUtils.removeMask3(true);
     }
   }
 );
@@ -109,7 +109,7 @@ const init = () => {
         mapState.zoom = map.getView().getZoom().toFixed(2);
       });
       if (props.showMask) {
-        mapUtils.createVecByJson(mmJson, '茂名市');
+        mapUtils.createVecByJson2(mmJson, { strokeWeight: 2 });
       }
       handleResize();
     }

+ 69 - 65
src/components/Map/company-map.vue

@@ -16,7 +16,8 @@
         </div>
 
         <el-scrollbar class="scroll" style="height: 250px;">
-          <div v-show="searchList.length" class="item" v-for="(item, index) in searchList" :key="index" @click="handlePanTo(index)">
+          <div v-show="searchList.length" class="item" v-for="(item, index) in searchList" :key="index"
+               @click="handlePanTo(index)">
             <el-image class="img" :src="item.img" :alt="item.name" lazy>
               <div slot="error" class="image-slot">
                 <i class="el-icon-picture-outline"></i>
@@ -30,7 +31,9 @@
           <div class="empty" v-show="!searchList.length" style="text-align: center;">没有搜索到内容</div>
         </el-scrollbar>
 
-        <el-pagination background small :hide-on-single-page="true" layout="prev, pager, next" :total="total" :page-size="pageSize" :current-page="pageNum" style="margin-top: 10px;" @current-change="handleChangePage">
+        <el-pagination background small :hide-on-single-page="true" layout="prev, pager, next" :total="total"
+                       :page-size="pageSize" :current-page="pageNum" style="margin-top: 10px;"
+                       @current-change="handleChangePage">
         </el-pagination>
       </div>
     </div>
@@ -44,7 +47,7 @@
 </template>
 
 <script>
-import AMapLoader from '@amap/amap-jsapi-loader'
+import AMapLoader from '@amap/amap-jsapi-loader';
 
 export default {
   props: {
@@ -52,20 +55,20 @@ export default {
       type: String,
       default: () => {
         return '';
-      },
+      }
     },
     latAndLong: {//经纬度
       type: Array,
       default: () => {
         return [];
-      },
+      }
     },
     visible: {
       type: Boolean,
       default: () => {
         return false;
-      },
-    },
+      }
+    }
   },
   data() {
     return {
@@ -94,16 +97,16 @@ export default {
     async visible(n) {
       this.mapPop = n;
       if (n) {
-        await this.initMap()
+        await this.initMap();
         this.location = this.address;
-        this.handleInput(0)
+        this.handleInput(0);
       }
     }
   },
   destroyed() {
     if (this.map) {
-      this.map.destroy()
-      this.map.off('rightclick')
+      this.map.destroy();
+      this.map.off('rightclick');
     }
   },
   methods: {
@@ -111,8 +114,8 @@ export default {
       if (!this.location) return;
 
       if (!flag) {//搜索
-        this.total = 0
-        this.pageNum = 1
+        this.total = 0;
+        this.pageNum = 1;
       }
 
       const that = this;
@@ -121,15 +124,15 @@ export default {
           pageSize: 10, // 每页条数,默认10,范围1-50
           pageIndex: 1, // 页码
           extensions: 'all' // 默认base,返回基本地址信息;all:返回详细信息
-        })
+        });
       }
 
       this.searchPop = true;
-      this.placeSearch.setPageIndex(this.pageNum)
+      this.placeSearch.setPageIndex(this.pageNum);
       this.placeSearch.search(that.location, (status, result) => {
         // console.log(result.poiList.pois, 'result')
         if (!!result.poiList && result.poiList.pois && result.poiList.pois.length > 0) {
-          let arr = []
+          let arr = [];
           const pois = result.poiList.pois;
           that.total = result.poiList ? result.poiList.count : 0;
           arr = pois.map((item) => {
@@ -138,46 +141,46 @@ export default {
               address: item.address,
               img: item.photos[0]?.url,
               lnglat: [item.location.lng, item.location.lat]
-            }
-          })
-          that.searchList = arr
+            };
+          });
+          that.searchList = arr;
 
         } else {
-          that.total = 0
-          that.searchList = []
+          that.total = 0;
+          that.searchList = [];
         }
 
-      })
+      });
     },
     handleChangePage(newNum) {
       if (!this.searchPop) return;
-      this.pageNum = newNum
-      this.handleInput(1)
+      this.pageNum = newNum;
+      this.handleInput(1);
     },
     closeSearchList() {
-      this.searchPop = false
-      this.location = ''
-      this.searchList = []
-      this.total = 0
-      this.pageNum = 1
+      this.searchPop = false;
+      this.location = '';
+      this.searchList = [];
+      this.total = 0;
+      this.pageNum = 1;
     },
     // 地图中心的平移至指定点位置
     handlePanTo(index) {
-      let lnglat = this.searchList[index].lnglat
+      let lnglat = this.searchList[index].lnglat;
       this.form = {
         longitude: lnglat[0],
         latitude: lnglat[1]
-      }
-      this.map.panTo(lnglat)
+      };
+      this.map.panTo(lnglat);
       this.setMarks(lnglat);
-      this.closeSearchList()
+      this.closeSearchList();
     },
     async initMap() {
       let position = this.latAndLong.length ? this.latAndLong : [110.925175, 21.678955];
       this.form = {
         longitude: position[0],
         latitude: position[1]
-      }
+      };
       window._AMapSecurityConfig = {
         securityJsCode: '4868bc1b8fac7d9e54e7279ed556879a'
       };
@@ -185,21 +188,21 @@ export default {
         key: '9c5041381e5e824f9ee324d8f7a40150',     // 申请好的Web端开发者Key,首次调用 load 时必填
         version: '2.0',      // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
         plugins: ['AMap.PlaceSearch', 'AMap.ContextMenu', 'AMap.PolygonEditor', 'AMap.Geocoder']       // 插件列表
-      })
+      });
       this.map = new AMap.Map('map', {
         viewMode: '3D',    //是否为3D地图模式
         center: position,
         zoom: 15
-      })
-      this.amap = AMap
+      });
+      this.amap = AMap;
 
       this.setMarks(position);
       this.geocoder = new AMap.Geocoder({
         // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode
         city: '010'
-      })
+      });
       // 创建右键菜单
-      this.ContextMenu()
+      this.ContextMenu();
       this.map.on('rightclick', this.handleRightclick);
 
     },
@@ -209,11 +212,11 @@ export default {
         this.form = {
           longitude: this.lnglatPosition[0],
           latitude: this.lnglatPosition[1]
-        }
-        this.contextMenu.close()
+        };
+        this.contextMenu.close();
         let lnglat = [this.form.longitude, this.form.latitude];
         this.setMarks(lnglat);
-      }, 1)
+      }, 1);
     },
     // 右键事件
     handleRightclick(e) {
@@ -226,9 +229,9 @@ export default {
       this.geocoder.getAddress(lnglat, (status, result) => {
         if (status === 'complete' && result.info === 'OK') {
           // result为对应的地理位置详细信息
-          this.$emit("confirm", { lnglat: lnglat, address: result.regeocode.formattedAddress });
+          this.$emit('confirm', { lnglat: lnglat, address: result.regeocode.formattedAddress });
         }
-      })
+      });
     },
     setMarks(lnglat) {//添加标记
       if (this.marker) this.map.remove(this.marker);
@@ -237,7 +240,7 @@ export default {
         icon: new AMap.Icon({
           size: new AMap.Size(22, 28),  //图标所处区域大小
           imageSize: new AMap.Size(22, 28), //图标大小
-          image: "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png",
+          image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png'
         }),
         anchor: 'bottom-center',
         offset: new AMap.Pixel(0, 0)
@@ -246,7 +249,7 @@ export default {
       this.marker = marker;
     },
     handleClose() {
-      this.$emit('update:visible', false)
+      this.$emit('update:visible', false);
     }
   }
 };
@@ -260,10 +263,12 @@ export default {
   background: rgba(0, 0, 0, 0.3);
   margin-bottom: 20px;
 }
+
 .map {
   width: 100%;
   height: 100%;
 }
+
 .search {
   width: 50%;
   position: absolute;
@@ -274,6 +279,7 @@ export default {
   border-radius: 3px;
   display: flex;
 }
+
 .btn {
   margin-left: 10px;
 }
@@ -288,6 +294,7 @@ export default {
   top: 70px;
   padding: 15px;
   border-radius: 3px;
+
   .close {
     position: absolute;
     right: 2%;
@@ -296,6 +303,7 @@ export default {
     font-size: 20px;
   }
 }
+
 .scroll {
   width: 100%;
   max-height: 250px;
@@ -317,18 +325,16 @@ export default {
       margin-right: 10px;
     }
 
-    &::v-deep {
-      .image-slot {
-        width: 100%;
-        height: 100%;
-        background-color: #f5f7fa;
-        text-align: center;
-        line-height: 50px;
-      }
+    :deep(.image-slot) {
+      width: 100%;
+      height: 100%;
+      background-color: #f5f7fa;
+      text-align: center;
+      line-height: 50px;
+    }
 
-      .el-icon-picture-outline {
-        font-size: 25px;
-      }
+    :deep(.el-icon-picture-outline) {
+      font-size: 25px;
     }
 
     .text {
@@ -337,15 +343,13 @@ export default {
     }
   }
 }
-::v-deep {
-  .el-scrollbar__wrap {
-    overflow-x: hidden !important;
-  }
-
-  .is-horizontal {
-    display: none;
-  }
+:deep(.el-scrollbar__wrap) {
+  overflow-x: hidden !important;
+}
+:deep(.is-horizontal) {
+  display: none;
 }
+
 .empty {
   margin: 20px 0;
 }

+ 1 - 1
src/components/Map/index.vue

@@ -409,7 +409,7 @@ watch(
     if (props.showMask) {
       creatMask2(mmJson, { strokeWeight: 2 });
     } else {
-      removeMask2();
+      removeMask2(true);
     }
   }
 );

+ 63 - 58
src/hooks/AMap/useAMap.ts

@@ -275,56 +275,43 @@ export function useAMap(options) {
   };
   let maskPolygon2 = [];
   const creatMask2 = (data, option) => {
-    data = convertCoordinates(data);
-    // 遮罩部分
-    const outer = [
-      new AMap.LngLat(-180, 90, true),
-      new AMap.LngLat(-180, -90, true),
-      new AMap.LngLat(180, -90, true),
-      new AMap.LngLat(180, 90, true)
-    ];
-    const pathArray = [outer];
-    // 合并区边界
-    const data2 = mergeGeoJsonPolygons(data);
-    data2.geometry.coordinates.forEach((coords) => {
-      pathArray.push(coords[0]);
-    });
-    maskPolygon = new AMap.Polygon({
-      path: pathArray,
-      strokeColor: option.strokeColor ? option.strokeColor : '#268ab9',
-      strokeOpacity: 1,
-      strokeWeight: option.strokeWeight ? option.strokeWeight : 1,
-      fillColor: option.fillColor ? option.fillColor : '#10243b',
-      fillOpacity: option.fillOpacity ? option.fillOpacity : 0.65
-    });
-    map.add(maskPolygon);
-    // 边界部分
-    data.features.forEach((feature) => {
-      if (feature.geometry.type === 'Polygon') {
-        const polygonPath = feature.geometry.coordinates[0].map((coord) => {
-          return [coord[0], coord[1]];
-        });
-        const polygon = new AMap.Polygon({
-          path: polygonPath,
-          strokeColor: option.strokeColor ? option.strokeColor : '#268ab9',
-          strokeOpacity: option.strokeOpacity ? option.strokeOpacity : 1,
-          strokeWeight: option.strokeWeight ? option.strokeWeight : 1,
-          fillOpacity: 0
-        });
-        maskPolygon2.push(polygon);
-        map.add(polygon);
-      } else if (feature.geometry.type === 'MultiPolygon') {
-        feature.geometry.coordinates.forEach((polygonCoords) => {
-          const polygonPath = polygonCoords.map((ring) => {
-            return ring.map((coord) => {
-              return [coord[0], coord[1]];
-            });
+    if (maskPolygon2 && maskPolygon2.length > 0) {
+      maskPolygon2.forEach((polygon) => {
+        polygon.show();
+      });
+    } else {
+      data = convertCoordinates(data);
+      // 遮罩部分
+      // const outer = [
+      //   new AMap.LngLat(-180, 90, true),
+      //   new AMap.LngLat(-180, -90, true),
+      //   new AMap.LngLat(180, -90, true),
+      //   new AMap.LngLat(180, 90, true)
+      // ];
+      // const pathArray = [outer];
+      // 合并区边界
+      // const data2 = mergeGeoJsonPolygons(data);
+      // data2.geometry.coordinates.forEach((coords) => {
+      //   pathArray.push(coords[0]);
+      // });
+      // const maskPolygon = new AMap.Polygon({
+      //   path: pathArray,
+      //   strokeColor: option.strokeColor ? option.strokeColor : '#268ab9',
+      //   strokeOpacity: 1,
+      //   strokeWeight: option.strokeWeight ? option.strokeWeight : 1,
+      //   fillColor: option.fillColor ? option.fillColor : '#10243b',
+      //   fillOpacity: option.fillOpacity ? option.fillOpacity : 0.65
+      // });
+      // maskPolygon2.push(maskPolygon);
+      // map.add(maskPolygon);
+      // 边界部分
+      data.features.forEach((feature) => {
+        if (feature.geometry.type === 'Polygon') {
+          const polygonPath = feature.geometry.coordinates[0].map((coord) => {
+            return [coord[0], coord[1]];
           });
-          const outerPath = polygonPath[0];
-          const innerPaths = polygonPath.slice(1);
           const polygon = new AMap.Polygon({
-            path: outerPath,
-            holes: innerPaths,
+            path: polygonPath,
             strokeColor: option.strokeColor ? option.strokeColor : '#268ab9',
             strokeOpacity: option.strokeOpacity ? option.strokeOpacity : 1,
             strokeWeight: option.strokeWeight ? option.strokeWeight : 1,
@@ -332,20 +319,38 @@ export function useAMap(options) {
           });
           maskPolygon2.push(polygon);
           map.add(polygon);
-        });
-      }
-    });
-  };
-  const removeMask2 = () => {
-    if (!!maskPolygon) {
-      map.remove(maskPolygon);
-      maskPolygon = null;
+        } else if (feature.geometry.type === 'MultiPolygon') {
+          feature.geometry.coordinates.forEach((polygonCoords) => {
+            const polygonPath = polygonCoords.map((ring) => {
+              return ring.map((coord) => {
+                return [coord[0], coord[1]];
+              });
+            });
+            const outerPath = polygonPath[0];
+            const innerPaths = polygonPath.slice(1);
+            const polygon = new AMap.Polygon({
+              path: outerPath,
+              holes: innerPaths,
+              strokeColor: option.strokeColor ? option.strokeColor : '#268ab9',
+              strokeOpacity: option.strokeOpacity ? option.strokeOpacity : 1,
+              strokeWeight: option.strokeWeight ? option.strokeWeight : 1,
+              fillOpacity: 0
+            });
+            maskPolygon2.push(polygon);
+            map.add(polygon);
+          });
+        }
+      });
     }
+  };
+  const removeMask2 = (isHidden) => {
     if (maskPolygon2 && maskPolygon2.length > 0) {
       maskPolygon2.forEach((polygon) => {
-        map.remove(polygon);
+        polygon.hide();
       });
-      maskPolygon2 = [];
+      if (!isHidden) {
+        maskPolygon2 = [];
+      }
     }
   };
   let moveMarker, movePolyline, movePassedPolyline, timerId;

+ 4 - 0
src/types/auto-imports.d.ts

@@ -312,6 +312,10 @@ declare module 'vue' {
   interface GlobalComponents {}
   interface ComponentCustomProperties {
     readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
+    readonly ElLoading: UnwrapRef<typeof import('element-plus/es')['ElLoading']>
+    readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
+    readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']>
+    readonly ElNotification: UnwrapRef<typeof import('element-plus/es')['ElNotification']>
     readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
     readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
     readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>

+ 2 - 0
src/types/components.d.ts

@@ -30,7 +30,9 @@ declare module 'vue' {
     ElBadge: typeof import('element-plus/es')['ElBadge']
     ElButton: typeof import('element-plus/es')['ElButton']
     ElCard: typeof import('element-plus/es')['ElCard']
+    ElCascader: typeof import('element-plus/es')['ElCascader']
     ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
+    ElCheckboxButton: typeof import('element-plus/es')['ElCheckboxButton']
     ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
     ElCol: typeof import('element-plus/es')['ElCol']
     ElCollapse: typeof import('element-plus/es')['ElCollapse']

+ 104 - 2
src/utils/olMap/olMap.ts

@@ -27,6 +27,7 @@ import { fromExtent } from 'ol/geom/Polygon';
 import { LinearRing, Polygon } from 'ol/geom';
 import { Tile } from 'ol';
 import {Graticule} from "ol/layer";
+import { mergeGeoJsonPolygons } from '@/utils/gisUtils';
 // import olPlot from 'ol-plot';
 // import { activate } from '../ol-plot/ol-plot'
 
@@ -69,6 +70,7 @@ export class olMap {
   private plot;
   private vectorLayer;
   private maskLayer;
+  private maskLayer2 = [];
 
   constructor(options) {
     this.options = options;
@@ -330,7 +332,98 @@ export class olMap {
     });
     this.maskLayer.getSource().addFeature(convertFt);
   }
-
+  createVecByJson2(json, options) {
+    if (this.maskLayer2 && this.maskLayer2.length > 0) {
+      this.maskLayer2.forEach((layer) => {
+        this.map.addLayer(layer);
+      });
+    } else {
+      // const layer = new VectorLayer({
+      //   source: new VectorSource(),
+      //   style: new Style({
+      //     fill: new Fill({
+      //       color: options.fillColor ? options.fillColor : 'rgba(16, 36, 59, 0.65)'
+      //     }),
+      //     stroke: new Stroke({
+      //       color: options.strokeColor ? options.strokeColor : 'rgba(38, 138, 185, 1)',
+      //       width: 2
+      //     })
+      //   }),
+      //   zIndex: options.zIndex ? options.zIndex : 99
+      // });
+      // // 合并区边界
+      // const format = new GeoJSON();
+      // const data2 = mergeGeoJsonPolygons(json);
+      // const fs = format.readFeatures(data2);
+      // const extent = [-180, -90, 180, 90];
+      // const polygonRing = fromExtent(extent);
+      // fs.forEach((x) => {
+      //   const ft = x.values_.geometry;
+      //   const coords = ft.getCoordinates();
+      //   coords.forEach((coord) => {
+      //     const linearRing = new LinearRing(coord[0]);
+      //     polygonRing.appendLinearRing(linearRing);
+      //   });
+      // });
+      // const convertFt = new Feature({
+      //   geometry: polygonRing
+      // });
+      // layer.getSource().addFeature(convertFt);
+      // this.maskLayer2.push(layer);
+      // this.map.addLayer(layer);
+      // 边界部分
+      json.features.forEach((feature) => {
+        if (feature.geometry.type === 'Polygon') {
+          const polygonPath = feature.geometry.coordinates[0].map((coord) => {
+            return [coord[0], coord[1]];
+          });
+          const feature2 = new Feature({
+            geometry: new Polygon([polygonPath])
+          });
+          const vector = new VectorLayer({
+            source: new VectorSource(),
+            style: new Style({
+              fill: new Fill({
+                color: 'rgba(0, 0, 0, 0)'
+              }),
+              stroke: new Stroke({
+                color: options.strokeColor ? options.strokeColor : '#268ab9',
+                width: options.strokeWeight ? options.strokeWeight : 1
+              })
+            })
+          });
+          vector.getSource().addFeature(feature2);
+          this.maskLayer2.push(vector);
+          this.map.addLayer(vector);
+        } else if (feature.geometry.type === 'MultiPolygon') {
+          feature.geometry.coordinates.forEach((polygonCoords) => {
+            const polygonPath = polygonCoords.map((ring) => {
+              return ring.map((coord) => {
+                return [coord[0], coord[1]];
+              });
+            });
+            const outerPath = polygonPath;
+            const feature2 = new Feature({ geometry: new Polygon(outerPath), });
+            const vector = new VectorLayer({
+              source: new VectorSource(),
+              style: new Style({
+                fill: new Fill({
+                  color: 'rgba(0, 0, 0, 0)'
+                }),
+                stroke: new Stroke({
+                  color: options.strokeColor ? options.strokeColor : '#268ab9',
+                  width: options.strokeWeight ? options.strokeWeight : 1
+                })
+              })
+            });
+            vector.getSource().addFeature(feature2);
+            this.maskLayer2.push(vector);
+            this.map.addLayer(vector);
+          });
+        }
+      });
+    }
+  }
   /**
    * @description 创建矢量图层
    * @param {String} layerName 图层名称
@@ -364,7 +457,6 @@ export class olMap {
           width: 1
         })
       });
-
       // 遮罩图层的矢量数据源(初始为空)
       const maskSource = new VectorSource();
       // 创建一个多边形特征
@@ -399,6 +491,16 @@ export class olMap {
       this.maskLayer = null;
     }
   }
+  removeMask3(isHide) {
+    if (this.maskLayer2 && this.maskLayer2.length > 0) {
+      this.maskLayer2.forEach((layer) => {
+        this.map.removeLayer(layer);
+      });
+      if (!isHide) {
+        this.maskLayer2 = [];
+      }
+    }
+  }
   /**
    * 绘制经纬线
    * visible: boolean 是否可见

+ 49 - 149
src/views/comprehensiveGuarantee/MaterialReserveManagement/InventoryDetails.vue

@@ -2,28 +2,18 @@
 <!--企业画像-->
 <template>
   <div>
-    <div v-show="!BussinessAddState.show && !BussinessEditState.show " class="app-container">
+    <div class="app-container">
       <div>
         <transition name="fade">
           <div v-show="showSearch" class="mb-[10px]">
             <el-form ref="queryFormRef" :model="queryParams" :inline="true">
               <el-form-item :span="5" label="商品信息:" prop="area_code" label-width="auto">
-                <el-input
-                  v-model="queryParams.keyword1"
-                  placeholder="请输入物资ID"
-                  clearable
-                  @keyup.enter="handleQuery"
-                />
+                <el-input v-model="queryParams.keyword1" placeholder="请输入物资ID" clearable @keyup.enter="handleQuery" />
               </el-form-item>
-              <el-form-item  :span="5" label="出入库单号:"  prop="keyword" label-width="auto">
-                <el-input
-                  v-model="queryParams.keyword2"
-                  placeholder="请输入出入库单号"
-                  clearable
-                  @keyup.enter="handleQuery"
-                />
+              <el-form-item :span="5" label="出入库单号:" prop="keyword" label-width="auto">
+                <el-input v-model="queryParams.keyword2" placeholder="请输入出入库单号" clearable @keyup.enter="handleQuery" />
               </el-form-item>
-              <el-form-item  :span="5"  prop="keyword" label-width="auto">
+              <el-form-item :span="5" prop="keyword" label-width="auto">
                 <el-select v-model="queryParams.type" placeholder="全部" clearable>
                   <el-option v-for="item in type" :key="item.value" :label="item.label" :value="item.value"></el-option>
                 </el-select>
@@ -35,55 +25,46 @@
                 <el-button icon="Refresh" @click="resetQuery">重置</el-button>
               </el-form-item>
             </el-form>
-<!--            <el-row :gutter="10" class="mb8">-->
-<!--              <el-col :span="1.5">-->
-<!--                <el-button type="primary" icon="Plus" @click="handleAdd">新建</el-button>-->
-<!--              </el-col>-->
-<!--              <el-col :span="1.5">-->
-<!--                <el-button type="danger" plain :disabled="multiple" icon="Delete" @click="handleDelete(selectedRow)"> 删除 </el-button>-->
-<!--              </el-col>-->
-<!--            </el-row>-->
+            <!--            <el-row :gutter="10" class="mb8">-->
+            <!--              <el-col :span="1.5">-->
+            <!--                <el-button type="primary" icon="Plus" @click="handleAdd">新建</el-button>-->
+            <!--              </el-col>-->
+            <!--              <el-col :span="1.5">-->
+            <!--                <el-button type="danger" plain :disabled="multiple" icon="Delete" @click="handleDelete(selectedRow)"> 删除 </el-button>-->
+            <!--              </el-col>-->
+            <!--            </el-row>-->
           </div>
         </transition>
-        <el-table ref="multipleTable" v-loading="loading" :data="tableData" border :max-height="maxHeight" style="width: 96%" @selection-change="handleSelectionChange">
+        <el-table
+          ref="multipleTable"
+          v-loading="loading"
+          :data="tableData"
+          border
+          :max-height="maxHeight"
+          style="width: 96%"
+          @selection-change="handleSelectionChange"
+        >
           <el-table-column type="selection" width="55" align="center" fixed />
-          <el-table-column label="商品信息" align="center" prop="goods_information" fixed show-overflow-tooltip/>
-          <el-table-column label="出入库单号" align="center" prop="odd_numbers" show-overflow-tooltip/>
-          <el-table-column label="入库/出库" align="center" prop="type" show-overflow-tooltip/>
-          <el-table-column label="变动库存" align="center" prop="change_inventory" show-overflow-tooltip/>
-          <el-table-column label="剩余库存" align="center" prop="remaining_inventory" show-overflow-tooltip/>
-          <el-table-column label="创建时间" align="center" prop="created_time" show-overflow-tooltip/>
-<!--          <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">-->
-<!--            <template #default="scope">-->
-<!--              <el-button type="text" class="common-btn-text-primary" @click="handleedit(scope.row)">编辑</el-button>-->
-<!--              <el-button type="text" class="common-btn-text-primary" @click="handleDelete(scope.row)">移除</el-button>-->
-<!--            </template>-->
-<!--          </el-table-column>-->
+          <el-table-column label="商品信息" align="center" prop="goods_information" fixed show-overflow-tooltip />
+          <el-table-column label="出入库单号" align="center" prop="odd_numbers" show-overflow-tooltip />
+          <el-table-column label="入库/出库" align="center" prop="type" show-overflow-tooltip />
+          <el-table-column label="变动库存" align="center" prop="change_inventory" show-overflow-tooltip />
+          <el-table-column label="剩余库存" align="center" prop="remaining_inventory" show-overflow-tooltip />
+          <el-table-column label="创建时间" align="center" prop="created_time" show-overflow-tooltip />
         </el-table>
-        <pagination
-          v-show="total > 0"
-          v-model:page="queryParams.page"
-          v-model:limit="queryParams.pageSize"
-          :total="total"
-          @pagination="tableData"
-        />
+        <pagination v-show="total > 0" v-model:page="queryParams.page" v-model:limit="queryParams.pageSize" :total="total" @pagination="tableData" />
       </div>
     </div>
-    <BussinessAdd v-if="BussinessAddState.show"  @close="handleCancel" />
-    <BussinessEdit v-if="BussinessEditState.show" :event-id="BussinessEditState.eventId"  @close="handleCancel" />
   </div>
 </template>
 
 <script setup lang="ts">
-import { ref,reactive, onMounted, onBeforeUnmount } from "vue";
-import {companyDelete, getCompanyList} from "@/api/riskPrevention/BusinessPortraits";
-import BussinessAdd from "@/views/riskPrevention/SafetyProductionManagement/BussinessAdd.vue";
-// import BussinessEdit from "./BussinessEdit.vue";
-import {to} from "await-to-js";
+import { ref, reactive, onMounted, onBeforeUnmount } from 'vue';
+import { getMovementList } from '@/api/comprehensiveGuarantee/materialReserveManagement/InventoryDetails';
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const showSearch = ref(true);
-// const tableData = ref();
+const tableData = ref();
 const multiple = ref(true);
 const ids = ref<Array<number | string>>([]);
 const single = ref(true);
@@ -103,61 +84,18 @@ const initFormData = reactive({
   remaining_inventory: '',
   created_time: ''
 });
-const data =reactive({
-  form: {...initFormData},
-  queryParams:{
+const data = reactive({
+  form: { ...initFormData },
+  queryParams: {
     page: '1',
     pageSize: '10',
-    type: '',
-    keycode1: '',
-    keyword2: ''
+    material_id: '',
+    io_number: '',
+    io_flag: ''
   },
   selectedRow: null,
   selectedRowKeys: []
 });
-const tableData = ref([
-  {
-    "goods_information": "苹果 iPhone 13 Pro Max 256GB 石墨色",
-    "odd_numbers": "WH20230401001",
-    "type": "入库",
-    "change_inventory": 50,
-    "remaining_inventory": 200,
-    "created_time": "2023-04-01T10:30:00Z"
-  },
-  {
-    "goods_information": "华为 MateBook X Pro 笔记本电脑",
-    "odd_numbers": "WH20230401002",
-    "type": "出库",
-    "change_inventory": -10,
-    "remaining_inventory": 190,
-    "created_time": "2023-04-01T11:15:00Z"
-  },
-  {
-    "goods_information": "小米 Redmi Note 11 Pro+ 5G 手机",
-    "odd_numbers": "WH20230401003",
-    "type": "入库",
-    "change_inventory": 30,
-    "remaining_inventory": 150,
-    "created_time": "2023-04-01T13:45:00Z"
-  },
-  {
-    "goods_information": "三星 Galaxy S22 Ultra 5G 手机",
-    "odd_numbers": "WH20230401004",
-    "type": "出库",
-    "change_inventory": -5,
-    "remaining_inventory": 55,
-    "created_time": "2023-04-01T15:00:00Z"
-  },
-  {
-    "goods_information": "戴尔 XPS 13 9310 笔记本电脑",
-    "odd_numbers": "WH20230402001",
-    "type": "入库",
-    "change_inventory": 15,
-    "remaining_inventory": 30,
-    "created_time": "2023-04-02T09:00:00Z"
-  }
-])
-
 
 const { queryParams, form } = toRefs(data);
 
@@ -169,58 +107,23 @@ const type = [
 
 const handleQuery = () => {
   queryParams.value.page = 1;
-  // fetchWorkrData();
+  fetchWorkrData();
 };
 const resetQuery = () => {
-  queryParams.value = { page: 1, pageSize: 10, area_code: '', keycode: '' };
+  queryParams.value = { page: 1, pageSize: 10, material_id: '', io_number: '', io_flag: '' };
   handleQuery();
 };
-const BussinessAddState = reactive({
-  show: false, // 初始化show为false
-});
-
-const BussinessEditState = reactive({
-  show:false
-});
-
-const handleAdd = () => {
-  BussinessAddState.show = true;
-};
-
-const handleDelete = async (row) => {
-  let id = [];
-  if (row) {
-    id = [row.id];
-  } else {
-    id = ids.value;
-  }
-  const [err] = await to(proxy?.$modal.confirm('是否确认删除选择的数据项?') as any);
-  if (!err) {
-    await companyDelete(id);
-    proxy.$modal.msgSuccess('删除成功');
-    fetchWorkrData();
-  }
-};
-const handleedit = (row) => {
-  BussinessEditState.eventId = row.id + "";
-  BussinessEditState.show = true;
-};
-
-const handleCancel = () => {
-  BussinessAddState.show = false;
-  BussinessEditState.show =false;
-};
 
 const fetchWorkrData = () => {
-  // loading.value = true;
-  // getCompanyList(queryParams.value)
-  //   .then((res) => {
-  //     tableData.value = res.data;
-  //     total.value = res.total;
-  //   })
-  //   .finally(() => {
-  //     loading.value = false;
-  //   });
+  loading.value = true;
+  getMovementList(queryParams.value)
+    .then((res) => {
+      tableData.value = res.data;
+      total.value = res.total;
+    })
+    .finally(() => {
+      loading.value = false;
+    });
 };
 
 const handleSelectionChange = (selection) => {
@@ -238,10 +141,7 @@ onMounted(() => {
 // 在组件卸载前移除窗口大小变化监听器
 onBeforeUnmount(() => {
   window.removeEventListener('resize', handleResize);
-
 });
 </script>
 
 <style lang="scss" scoped></style>
-
-

+ 2 - 2
src/views/informationissue/informationApplication.vue

@@ -334,8 +334,8 @@ onMounted(() => {
     background-size:20px;
 }
 
-::v-deep  .highlight {
-    color: #fd0f0f;
+:deep(.highlight) {
+  color: #fd0f0f;
 }
 
 .item_row {