Kaynağa Gözat

物资柜接口调用完毕,作业票放大锁定站数据位置调整

pm 9 ay önce
ebeveyn
işleme
c393563281

+ 9 - 1
src/router/index.js

@@ -271,10 +271,18 @@ export const dynamicRoutes = [
         path: 'DetailsIndex',
         component: () => import('@/views/mes/material/lockers/DetailsIndex'),
         name: 'DetailsIndex',
-        meta: { title: '物资柜详情' }
+        meta: {
+          title: '' // 初始为空
+        },
+        beforeEnter: (to, from, next) => {
+          // 动态设置菜单标题
+          to.meta.title = to.query.cabinetName || '默认标题';
+          next();
+        }
       }
     ]
   },
+
   {
     path: '/system/role-auth',
     component: Layout,

+ 43 - 10
src/views/mes/email/emailNotify/index.vue

@@ -82,7 +82,11 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column prop="name" label="提醒事项"></el-table-column>
       <el-table-column prop="templateName" label="邮件模板"></el-table-column>
-      <el-table-column prop="reminderTime" label="提醒时长"></el-table-column>
+      <el-table-column prop="reminderTime" label="提醒时长">
+        <template slot-scope="scope">
+          {{formattedTime(scope.row.reminderTime)}}
+        </template>
+      </el-table-column>
       <el-table-column
         label="操作"
         align="center"
@@ -321,7 +325,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.codes = selection.map((item) => item.templateCode);
+      this.codes = selection.map((item) => item.configId);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
@@ -336,36 +340,65 @@ export default {
     handleUpdate(row) {
       this.reset();
       this.isEdit = true;
-      getIsMailNotifyConfigById(row.templateCode).then((response) => {
+      getIsMailNotifyConfigById(row.configId).then((response) => {
         this.form = response.data;
+        const convertTime = (time) => ({
+          days: Math.floor(time / (24 * 60 * 60)),
+          hours: Math.floor((time % (24 * 60 * 60)) / (60 * 60)),
+          minutes: Math.floor((time % (60 * 60)) / 60),
+          seconds: time % 60,
+        });
+
+        this.timeValues.reminderTime = convertTime(response.data.reminderTime);
         this.open = true;
         this.title = "修改邮件模板";
       });
     },
+    // 时间转换
+    formattedTime(totalSeconds) {
+      const days = Math.floor(totalSeconds / (24 * 60 * 60));
+      const hours = Math.floor((totalSeconds % (24 * 60 * 60)) / (60 * 60));
+      const minutes = Math.floor((totalSeconds % (60 * 60)) / 60);
+      const seconds = totalSeconds % 60;
+
+      const parts = [];
+      if (days > 0) parts.push(`${days}天`);
+      if (hours > 0) parts.push(`${hours}小时`);
+      if (minutes > 0) parts.push(`${minutes}分钟`);
+      if (seconds > 0) parts.push(`${seconds}秒`);
+
+      return parts.join(" ");
+    },
     /** 提交按钮 */
     submitForm: function () {
+      const calculateTotalSeconds = ({ days, hours, minutes, seconds }) =>
+        ((days * 24 + hours) * 60 + minutes) * 60 + seconds;
+
+      this.form.reminderTime = calculateTotalSeconds(
+        this.timeValues.reminderTime
+      );
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.isEdit) {
+
             updateIsMailNotifyConfig(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            console.log(this.form.reminderTime,'提醒时长');
-            // addIsMailNotifyConfig(this.form).then((response) => {
-            //   this.$modal.msgSuccess("新增成功");
-            //   this.open = false;
-            //   this.getList();
-            // });
+            addIsMailNotifyConfig(this.form).then((response) => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
           }
         }
       });
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const templateCodes = row.templateCode || this.codes;
+      const templateCodes = row.conifgId || this.codes;
       this.$modal
         .confirm('是否确认删除名称为"' + templateCodes + '"的数据项?')
         .then(function () {

+ 2 - 2
src/views/mes/email/emailTemplates/index.vue

@@ -135,7 +135,7 @@
       @pagination="getList"
     />
     <!-- 添加或修改部门对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="450px" append-to-body>
+    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="120px">
         <el-form-item label="邮件模板编号" prop="templateCode">
           <el-input
@@ -149,7 +149,7 @@
         <el-form-item label="邮件模板内容" prop="templateContent">
           <el-input
             type="textarea"
-            :rows="10"
+            :rows="20"
             v-model="form.templateContent"
             placeholder="请输入邮件模板内容"
           />

+ 108 - 199
src/views/mes/job/jobm/LockDetail.vue

@@ -142,234 +142,143 @@ export default {
       this.renderGrid(imageSrc, 6, 3, 450, 100, 120, 100, 50, 50, 60, 25);
     },
 
-    // 绘制无限网格
-    // drawGrid(cellWidth, cellHeight, gridColor) {
-    //   const width = 1200
-    //   const height = 860
-    //
-    //   // 绘制竖线
-    //   for (let i = 0; i <= width; i += cellWidth) {
-    //     const verticalLine = new Konva.Line({
-    //       points: [i, 0, i, height],
-    //       stroke: gridColor,
-    //       strokeWidth: 1
-    //     })
-    //     this.layer.add(verticalLine)
-    //   }
-    //
-    //   // 绘制横线
-    //   for (let j = 0; j <= height; j += cellHeight) {
-    //     const horizontalLine = new Konva.Line({
-    //       points: [0, j, width, j],
-    //       stroke: gridColor,
-    //       strokeWidth: 1
-    //     })
-    //     this.layer.add(horizontalLine)
-    //   }
-    //
-    //   this.layer.draw()
-    // },
-
     renderGrid(imageSrc) {
-      this.selectedStates = [] // 用数组来存储选中状态
-      this.rects = {}
-      this.texts = {}
-      this.bgrects = {}
-      this.redrects = {}
-      this.redtexts = {}
-      this.selectedText = []
-      this.pointIdList = [] // 初始化选中的点ID列表
-
-      const positions = JSON.parse(this.value)
-
-      positions.forEach((pos, index) => {
-
-        let colOffset = 0;
-
-        // 计算当前元素在组中的位置
-        const groupSize = 3;
-        const groupIndex = Math.floor(index / groupSize);
-        const positionInGroup = index % groupSize;
-        //   每一行第二个和第三个增加col
-        if (positionInGroup === 1) {
-          colOffset = 3;
-        } else if (positionInGroup === 2) {
-          colOffset = 6;
-        }
-        // 根据索引调整行偏移量
-        if (groupIndex == 0) {
-          // 第一组(索引0,1,2)
-          pos.row += 0.1;
-
-        } else if (groupIndex == 1) {
-          // 第二组(索引3,4,5)
-          pos.row += 0.7;
-        } else if (groupIndex == 2) {
-          // 第三组及之后(索引6,7,8...)
-          pos.row += 1.3;
-        }else if (groupIndex == 3) {
-          // 第四组及之后(索引9,10,11...)
-          pos.row += 1.9;
-        }else{
-          pos.row += 2.2;
-        }
-
-        // console.log(pos.col,pos.row,'横纵坐标')
-        const x = (pos.col + colOffset) * 11;  // 每个单元格宽度为50
-        const y = pos.row * 25;                // 每个单元格高度为50             // 每个单元格高度为50
-        const labelText = pos.pointName // 对应的文字
-
-        const point = new Image()
-        point.src = pos.pointIcon
+      this.selectedStates = []; // 用数组存储选中状态
+      this.rects = {};
+      this.texts = {};
+      this.bgrects = {};
+      this.redrects = {};
+      this.redtexts = {};
+      this.selectedText = [];
+      this.pointIdList = []; // 初始化选中的点ID列表
+
+      const positions = JSON.parse(this.value); // 获取点位数据
+
+      // **计算柜子的布局范围**
+      const cabinetWidth = this.stage.width(); // 柜子的宽度
+      const cabinetHeight = this.stage.height(); // 柜子的高度
+      const cols = Math.max(...positions.map((p) => p.col)) + 1; // 根据数据动态计算总列数
+      const rows = Math.max(...positions.map((p) => p.row)) + 1; // 根据数据动态计算总行数
+      // 调整横向和纵向间距
+      const horizontalSpacingFactor = 1.032; // 横向间距放大倍数
+      const verticalSpacingFactor = 0.53; // 纵向间距缩小倍数
+
+      const cellWidth = (cabinetWidth / cols) * horizontalSpacingFactor; // 调整横向间距
+      const cellHeight = (cabinetHeight / rows) * verticalSpacingFactor; // 调整纵向间距
+
+      // 遍历点位,按行列布局计算位置
+      positions.forEach((pos) => {
+        const col = pos.col; // 当前点位的列
+        const row = pos.row; // 当前点位的行
+
+        // 计算点位的实际位置,确保它们位于柜子显示区域内
+        const x = col * cellWidth - 220; // 调整偏移量,使其向左移动
+        const y = row * cellHeight - 20; // 调整偏移量,使其向上移动
+
+        const labelText = pos.pointName; // 对应的文字
+
+        const point = new Image();
+        point.src = pos.pointIcon;
         point.onload = () => {
           const knovaImage = new Konva.Image({
-            x: x+1,
-            y: y+3,
+            x: x + 6, // 适当的偏移确保点位不重叠
+            y: y + 5, // 适当的偏移确保点位不重叠
             image: point,
-            width: 35,
-            height: 35,
-            draggable: false
-          })
-
+            width: 29, // 增加宽度
+            height: 28, // 增加高度
+            draggable: false,
+          });
 
-          // 底部白色背景
+          // **绘制背景矩形**(以单元格大小为基础)
           const bgrect = new Konva.Rect({
-            x: x - 6,
-            y: y - 5,
-            width: 45,
-            height: 58,
+            x: x,
+            y: y,
+            width: 40, // 增加宽度
+            height: 46, // 增加高度
             cornerRadius: 5,
-            stroke: 'white',
+            stroke: "white",
             strokeWidth: 2,
-            fill: 'white'
-          })
-          this.layer.add(bgrect)
-          this.bgrects[labelText] = bgrect // 用文字作为键存储
+            fill: "white",
+          });
+          this.layer.add(bgrect);
+          this.bgrects[labelText] = bgrect;
 
-          // 普通矩形
+          // **普通矩形边框**(同样按照单元格尺寸)
           const rect = new Konva.Rect({
-            x: x-4,
-            y: y-2,
-            width: 42,
-            height: 54,
+            x: x + 2,
+            y: y + 2,
+            width: 40 - 5, // 增加宽度
+            height: 46 - 4, // 增加高度
             cornerRadius: 5,
-            stroke: 'red',
+            stroke: "red",
             strokeWidth: 2,
-            fill: 'white'
-          })
-          this.layer.add(rect)
-          this.rects[labelText] = rect // 用文字作为键存储
-          // 先加底部白色 再添加图片
-          this.layer.add(knovaImage)
+            fill: "white",
+          });
+          this.layer.add(rect);
+          this.rects[labelText] = rect;
 
+          // 添加图片
+          this.layer.add(knovaImage);
 
-          // 普通文字
+          // **绘制点位的文字**(确保与背景矩形不重叠)
           const text = new Konva.Text({
-            x: x + 4,
-            y: y + 34,
+            x: x + 8, // 适当的偏移,确保文字不与背景矩形重叠
+            y: y + 46 - 15, // 文字放在底部
             fontSize: 14,
             text: labelText,
-            fontFamily: 'Calibri',
-            fill: 'red'
-          })
-          this.layer.add(text)
-          this.texts[labelText] = text // 用文字作为键存储
+            fontFamily: "Calibri",
+            fill: "red",
+          });
+          this.layer.add(text);
+          this.texts[labelText] = text;
 
-          // 覆盖层(表示选中状态
+          // **选中覆盖矩形**(保持与背景矩形相同的尺寸
           const redrect = new Konva.Rect({
-            x: x - 6,
-            y: y - 4,
-            width: 45,
-            height: 58,
+            x: x,
+            y: y,
+            width: 40, // 增加宽度
+            height: 46, // 增加高度
             cornerRadius: 5,
-            fill: 'rgba(97, 97, 97, 0.5)', // 半透明灰色
+            fill: "rgba(97, 97, 97, 0.5)", // 半透明灰色
             visible: false, // 初始状态隐藏
-            listening: false
-          })
-          this.layer.add(redrect)
-          this.redrects[labelText] = redrect // 用文字作为键存储
+            listening: false,
+          });
+          this.layer.add(redrect);
+          this.redrects[labelText] = redrect;
 
-          // 创建对号文本
+          // **对号文字(表示选中)**
           const redtext = new Konva.Text({
-            x: x - 2 + 26 / 2, // 水平居中
-            y: y + 38 / 2, // 垂直居中
-            fontSize: 13, // 根据需要调整字体大小
-            text: '✔',
-            fontFamily: 'Arial',
-            fill: 'white',
-            align: 'center',
-            verticalAlign: 'middle',
+            x: x + 40 / 2 - 5, // 水平居中
+            y: y + 46 / 2 - 5, // 垂直居中
+            fontSize: 13,
+            text: "✔",
+            fontFamily: "Arial",
+            fill: "white",
+            align: "center",
             visible: false, // 初始隐藏状态
-            listening: false
-          })
-          this.layer.add(redtext)
-          this.redtexts[labelText] = redtext // 用文字作为键存储
-
-          // 检查 selectPoints 是否存在并且不为空
-          if (Array.isArray(this.selectPoints) && this.selectPoints.length > 0) {
+            listening: false,
+          });
+          this.layer.add(redtext);
+          this.redtexts[labelText] = redtext;
+
+          // 如果初始化时有选中的点位
+          if (
+            Array.isArray(this.selectPoints) &&
+            this.selectPoints.length > 0
+          ) {
             if (this.selectPoints.includes(pos.pointId)) {
               // 设置选中状态
-              this.redrects[labelText].visible(true)
-              this.redtexts[labelText].visible(true)
-              this.pointIdList.push(pos.pointId) // 添加ID
+              this.redrects[labelText].visible(true);
+              this.redtexts[labelText].visible(true);
+              this.pointIdList.push(pos.pointId); // 添加ID
             }
           }
 
-          this.layer.draw()
-          // const positions = [{
-          //   row: 2,
-          //   col: 9,
-          //   pointId: '11',
-          //   pointName: 'E-11',
-          //   state: false,
-          //   pointIcon: 'http://36.133.174.236:9091/prod-api/profile/upload/2024/11/27/point_20241127152959A071.png',
-          //   pointPicture: 'http://36.133.174.236:9091/prod-api/profile/upload/2024/10/31/AB54CB1D-40BC-409d-BFFD-F55664CF3F01_20241031171608A034.png',
-          //
-          // }, {
-          //   row: 2,
-          //   col: 11,
-          //   pointId: '12',
-          //   pointName: 'E-12',
-          //   state: false,
-          //   pointIcon: 'http://36.133.174.236:9091/prod-api/profile/upload/2024/11/27/point_20241127152952A070.png',
-          //   pointPicture: 'http://36.133.174.236:9091/prod-api/profile/upload/2024/10/31/AB54CB1D-40BC-409d-BFFD-F55664CF3F01_20241031171627A036.png',
-          // }, {
-          //   row: 2,
-          //   col: 13,
-          //   pointId: '13',
-          //   pointName: 'E-13',
-          //   state: false,
-          //   pointIcon: 'http://36.133.174.236:9091/prod-api/profile/upload/2024/11/27/point_20241127152946A069.png',
-          //   pointPicture: 'http://36.133.174.236:9091/prod-api/profile/upload/2024/10/31/AB54CB1D-40BC-409d-BFFD-F55664CF3F01_20241031171651A038.png',
-          // },{
-          //   row: 4,
-          //   col: 9,
-          //   pointId: '7',
-          //   pointName: 'E-7',
-          //   state: true,
-          //   pointIcon: 'http://36.133.174.236:9091/prod-api/profile/upload/2024/11/27/point_20241127152959A071.png',
-          //   pointPicture: 'http://36.133.174.236:9091/prod-api/profile/upload/2024/10/31/AB54CB1D-40BC-409d-BFFD-F55664CF3F01_20241031171608A034.png',
-          //
-          // }, {
-          //   row: 4,
-          //   col: 11,
-          //   pointId: '8',
-          //   pointName: 'E-8',
-          //   state: true,
-          //   pointIcon: 'http://36.133.174.236:9091/prod-api/profile/upload/2024/11/27/point_20241127152952A070.png',
-          //   pointPicture: 'http://36.133.174.236:9091/prod-api/profile/upload/2024/10/31/AB54CB1D-40BC-409d-BFFD-F55664CF3F01_20241031171627A036.png',
-          // }, {
-          //   row: 4,
-          //   col: 13,
-          //   pointId: '9',
-          //   pointName: 'E-9',
-          //   state: true,
-          //   pointIcon: 'http://36.133.174.236:9091/prod-api/profile/upload/2024/11/27/point_20241127152946A069.png',
-          //   pointPicture: 'http://36.133.174.236:9091/prod-api/profile/upload/2024/10/31/AB54CB1D-40BC-409d-BFFD-F55664CF3F01_20241031171651A038.png',
-          // }]
-        }
-      })
-    }
+          this.layer.draw(); // 刷新画布
+        };
+      });
+    },
+
   }
 }
 </script>

+ 148 - 103
src/views/mes/material/Inspectionrecords/index.vue

@@ -8,43 +8,21 @@
       v-show="showSearch"
       label-width="100px"
     >
-      <el-form-item label="计划名称" prop="materialsCode">
+      <el-form-item label="计划名称" prop="planName">
         <el-input
-          v-model="queryParams.materialsCode"
+          v-model="queryParams.planName"
           placeholder="请输入计划名称"
           clearable
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="计划日期">
-        <el-date-picker
-          style="width: 215px"
-          :default-time="['00:00:00', '23:59:59']"
-          v-model="createTime"
-          type="datetimerange"
-          :picker-options="pickerOptions"
-          range-separator="-"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          align="right"
-        >
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="岗位" prop="workstationId">
-        <treeselect
-          style="width: 218px"
-          v-model="queryParams.workstationId"
-          :options="marsOptions"
-          :normalizer="normalizer"
-          placeholder="选择岗位"
-        />
-      </el-form-item>
-      <el-form-item label="物资柜" prop="cabinetIdStr">
+
+      <el-form-item label="物资柜" prop="cabinetId">
         <el-select
           style="width: 208px"
-          v-model="queryParams.cabinetIdStr"
+          v-model="queryParams.cabinetId"
           placeholder="请选择物资柜"
-          multiple
+
           clearable
         >
           <el-option
@@ -72,26 +50,53 @@
           placeholder="请选择物资类型"
         />
       </el-form-item>
+      <el-form-item label="RFID" prop="materialsRfid">
+        <el-input
+          v-model="queryParams.materialsRfid"
+          placeholder="请输入RFID"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="检查时间">
+        <el-date-picker
+          style="width: 215px"
+          :default-time="['00:00:00', '23:59:59']"
+          v-model="createTime"
+          type="datetimerange"
+          :picker-options="pickerOptions"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          align="right"
+        >
+        </el-date-picker>
+      </el-form-item>
+<!--      <el-form-item label="岗位" prop="workstationId">-->
+<!--        <treeselect-->
+<!--          style="width: 218px"-->
+<!--          v-model="queryParams.workstationId"-->
+<!--          :options="marsOptions"-->
+<!--          :normalizer="normalizer"-->
+<!--          placeholder="选择岗位"-->
+<!--        />-->
+<!--      </el-form-item>-->
+
+
       <el-form-item label="状态" prop="status">
         <el-select v-model="queryParams.status" placeholder="状态">
           <el-option
-            v-for="dict in dict.type.checking_status"
+            v-for="dict in dict.type.checks_status"
             :key="dict.value"
             :label="dict.label"
             :value="dict.value"
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="异常原因" prop="cabinetIdStr">
-        <el-select
-          style="width: 208px"
-          v-model="queryParams.cabinetIdStr"
-          placeholder="请选择异常原因"
-          multiple
-          clearable
-        >
+      <el-form-item label="异常原因" prop="reason">
+        <el-select v-model="queryParams.reason" placeholder="状态">
           <el-option
-            v-for="dict in cabinets"
+            v-for="dict in dict.type.exceptions_status"
             :key="dict.value"
             :label="dict.label"
             :value="dict.value"
@@ -119,31 +124,39 @@
       </el-form-item>
     </el-form>
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          v-no-more-click
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['iscs:check:add']"
-        >新增
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          v-no-more-click
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['iscs:check:remove']"
-        >批量删除
-        </el-button>
-      </el-col>
+      <el-button v-no-more-click
+                 type="warning"
+                 plain
+                 icon="el-icon-download"
+                 size="mini"
+                 @click="handleExport"
+                 v-hasPermi="['iscs:check:export']"
+      >导出</el-button>
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          v-no-more-click-->
+<!--          type="primary"-->
+<!--          plain-->
+<!--          icon="el-icon-plus"-->
+<!--          size="mini"-->
+<!--          @click="handleAdd"-->
+<!--          v-hasPermi="['iscs:check:add']"-->
+<!--        >新增-->
+<!--        </el-button>-->
+<!--      </el-col>-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          v-no-more-click-->
+<!--          type="danger"-->
+<!--          plain-->
+<!--          icon="el-icon-delete"-->
+<!--          size="mini"-->
+<!--          :disabled="multiple"-->
+<!--          @click="handleDelete"-->
+<!--          v-hasPermi="['iscs:check:remove']"-->
+<!--        >批量删除-->
+<!--        </el-button>-->
+<!--      </el-col>-->
       <right-toolbar
         :showSearch.sync="showSearch"
         @queryTable="getList"
@@ -155,9 +168,12 @@
       @selection-change="handleSelectionChange"
     >
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="计划名称" align="center" prop="planId">
+      <el-table-column label="计划名称" align="center" prop="planName" width="200">
+        <template slot-scope="scope">
+          {{scope.row.planName}}
+        </template>
       </el-table-column>
-      <el-table-column label="物资柜" align="center" prop="cabinetId">
+      <el-table-column label="物资柜" align="center" prop="cabinetName">
       </el-table-column>
       <el-table-column label="物资编号" align="center" prop="materialsId">
       </el-table-column>
@@ -180,7 +196,6 @@
       </el-table-column>
       <el-table-column label="RFID" align="center" prop="materialsRfid">
       </el-table-column>
-
       <el-table-column
         label="检查时间"
         align="center"
@@ -193,48 +208,51 @@
       </el-table-column>
       <el-table-column label="状态" align="center" prop="status">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.checking_status" :value="scope.row.status"/>
+          <dict-tag :options="dict.type.checks_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="异常原因" align="center" prop="reason">
-      </el-table-column>
-      <el-table-column label="更换记录" align="center" prop="status">
         <template slot-scope="scope">
-          <el-button type="text" @click="goto">查看</el-button>
+          <dict-tag :options="dict.type.exceptions_status" :value="scope.row.reason"/>
         </template>
       </el-table-column>
-      <el-table-column
-        label="操作"
-        align="center"
-        class-name="small-padding fixed-width"
-      >
+      <el-table-column label="更换记录" align="center" prop="status">
         <template slot-scope="scope">
-          <el-button
-            v-no-more-click
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['iscs:check:edit']"
-          >编辑
-          </el-button>
-
-          <el-button
-            v-no-more-click
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['iscs:check:remove']"
-          >删除
-          </el-button>
+          <el-button type="text" @click="goto(scope.row)">查看</el-button>
         </template>
       </el-table-column>
+<!--      <el-table-column-->
+<!--        label="操作"-->
+<!--        align="center"-->
+<!--        class-name="small-padding fixed-width"-->
+<!--      >-->
+<!--        <template slot-scope="scope">-->
+<!--          <el-button-->
+<!--            v-no-more-click-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-edit"-->
+<!--            @click="handleUpdate(scope.row)"-->
+<!--            v-hasPermi="['iscs:check:edit']"-->
+<!--          >编辑-->
+<!--          </el-button>-->
+
+<!--          <el-button-->
+<!--            v-no-more-click-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-delete"-->
+<!--            @click="handleDelete(scope.row)"-->
+<!--            v-hasPermi="['iscs:check:remove']"-->
+<!--          >删除-->
+<!--          </el-button>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
     </el-table>
     <pagination
       v-show="total > 0"
       :total="total"
-      :page.sync="queryParams.pages"
+      :page.sync="queryParams.current"
       :limit.sync="queryParams.size"
       @pagination="getList"
     />
@@ -369,7 +387,13 @@ import { listPlan } from '@/api/mes/material/plan'
 export default {
   name: 'Team',
   components: { Template, Treeselect },
-  dicts: ['material_status','checking_status'],
+  props:{
+    cabinetId:{
+      type:String,
+      required:true
+    }
+  },
+  dicts: ['material_status','checks_status','exceptions_status'],
   data() {
     return {
       //自动生成编码
@@ -399,15 +423,17 @@ export default {
       // 查询参数
       createTime: '',
       queryParams: {
-        pages: 1,
+        current: 1,
         size: 10,
-        materialsCode: null,
+        materialsRfid:'',
         materialsName: null,
         loanState: null,
         materialsCabinetId: null,
         materialsTypeId: null,
         startTime: '',
-        endTime: ''
+        endTime: '',
+        reason:'',
+        status:'',
       },
       // 表单参数
       form: {},
@@ -466,11 +492,19 @@ export default {
     this.getList()
     this.getTreeselect()
     this.materialsCabinets()
+    this.queryParams.planName = this.$route.query.planName
+    this.queryParams.cabinetId = this.cabinetId
   },
 
   methods: {
-    goto(){
 
+    goto(row){
+      this.$router.push({
+        path:'/material/replacementrecords',
+        query:{
+          recordId:row.recordId,
+        }
+      })
     },
     formatDate(date) {
       const year = date.getFullYear().toString().padStart(2, "0");
@@ -490,7 +524,12 @@ export default {
         this.queryParams.startTime = this.formatDate(this.createTime[0])
         this.queryParams.endTime = this.formatDate(this.createTime[1])
       }
-      listCheckRecord(this.queryParams).then((response) => {
+      const data={
+        ...this.queryParams,
+        planId:this.$route.query.planId
+      }
+      listCheckRecord(data).then((response) => {
+        console.log(response,'response')
         this.RecordList = response.data.records
         this.total = response.data.total
         this.loading = false
@@ -531,7 +570,8 @@ export default {
       // 岗位查询
       const data3 = {
         pasge: 1,
-        size: -1
+        size: -1,
+        parentId:'0'
       }
       listMarsDept(data3).then((response) => {
         this.marsOptions = this.handleTree(response.data.records,"workstationId","parentId")
@@ -680,7 +720,12 @@ export default {
         })
     },
 
-
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('iscs/check/exportIsMaterialsCheckRecord', {
+        ...this.queryParams
+      }, `records_${new Date().getTime()}.xlsx`)
+    },
   }
 }
 </script>

+ 7 - 0
src/views/mes/material/collectionmanagement/index.vue

@@ -248,6 +248,12 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 export default {
   name: "Team",
   components: { Treeselect, Template },
+  props:{
+    cabinetId:{
+      type:String,
+      required:true
+    }
+  },
   dicts: ["sys_yes_no","record_of_collection"],
   data() {
     return {
@@ -339,6 +345,7 @@ export default {
     };
   },
   created() {
+    this.queryParams.loanFromId = this.cabinetId
     this.getList();
     this.getTreeselect()
     this.materialsCabinets();

+ 30 - 15
src/views/mes/material/inspectionplan/index.vue

@@ -96,18 +96,18 @@
         >新增
         </el-button>
       </el-col>
-       <el-col :span="1.5">
-        <el-button
-          v-no-more-click
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['iscs:plan:remove']"
-          >批量删除
-        </el-button>
+<!--       <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          v-no-more-click-->
+<!--          type="danger"-->
+<!--          plain-->
+<!--          icon="el-icon-delete"-->
+<!--          size="mini"-->
+<!--          :disabled="multiple"-->
+<!--          @click="handleDelete"-->
+<!--          v-hasPermi="['iscs:plan:remove']"-->
+<!--          >批量删除-->
+<!--        </el-button>-->
       </el-col>
       <right-toolbar
         :showSearch.sync="showSearch"
@@ -152,7 +152,7 @@
       </el-table-column>
       <el-table-column label="检查记录" align="center" prop="status">
         <template slot-scope="scope">
-          <el-button type="text" @click="goto">查看</el-button>
+          <el-button type="text" @click="goto(scope.row)">查看</el-button>
         </template>
       </el-table-column>
       <el-table-column
@@ -280,6 +280,12 @@ import { listUser } from '@/api/system/user'
 export default {
   name: 'Team',
   components: { Treeselect, Crontab },
+  props:{
+    cabinetId:{
+      type:String,
+      required:true
+    }
+  },
   dicts: ['material_status', 'checking_status'],
   data() {
     return {
@@ -315,6 +321,7 @@ export default {
         cabinetId:'',
         startTime:null,
         endTime:null,
+        status:''
       },
       // 表单参数
       form: {},
@@ -386,6 +393,7 @@ export default {
     }
   },
   created() {
+    this.queryParams.cabinetId = this.cabinetId
     this.getList()
     this.getOtherList()
   },
@@ -474,8 +482,15 @@ export default {
       }
       return names[0];
     },
-    goto(){
-
+    goto(row){
+      console.log(row,'goto检查计划查看')
+      this.$router.push({
+        path:'/material/Inspectionrecords',
+        query:{
+          planId:row.planId,
+          planName:row.planName,
+        }
+      })
     },
     // 取消按钮
     cancel() {

+ 11 - 7
src/views/mes/material/lockers/DetailsIndex.vue

@@ -9,23 +9,23 @@
     </el-radio-group>
     <!-- 物资清单 -->
     <div v-if="tabPosition == 'first'" class="materialsListcon">
-      <MaterialInfromation />
+      <MaterialInfromation :cabinetId="cabinetId"/>
     </div>
     <!-- 领取记录 -->
     <div v-if="tabPosition == 'second'" class="materialsListcon">
-      <CollectionManagement />
+      <CollectionManagement :cabinetId="cabinetId" />
     </div>
     <!-- 检查计划 -->
     <div v-if="tabPosition == 'third'" class="materialsListcon">
-      <InspectionPlan />
+      <InspectionPlan :cabinetId="cabinetId"/>
     </div>
     <!-- 检查记录 -->
     <div v-if="tabPosition == 'fourth'" class="materialsListcon">
-      <InspectionRecords />
+      <InspectionRecords :cabinetId="cabinetId"/>
     </div>
     <!-- 更换记录 -->
     <div v-if="tabPosition == 'fivth'" class="materialsListcon">
-      <ReplacementRecords />
+      <ReplacementRecords :cabinetId="cabinetId"/>
     </div>
   </div>
 </template>
@@ -48,11 +48,15 @@ export default {
   data() {
     return {
       tabPosition: "first", //顶部切换
+      cabinetId: null,
     };
   },
-  created() {},
+  created() {
+    this.cabinetId=this.$route.query.cabinetId;
+
+  },
   methods: {},
 };
 </script>
 <style lang="scss" scoped>
-</style>
+</style>

+ 297 - 463
src/views/mes/material/lockers/index.vue

@@ -53,47 +53,46 @@
         />
 
         <!-- deptCCO 区域的图标 -->
-        <img
-          v-for="(cabinet, index) in COCOTicketListPage"
-          :key="cabinet.cabinetId"
-          :style="{
-            width: '35px',
-            height: '35px',
-            position: 'absolute',
-            cursor: 'pointer',
-            // 图标垂直居中
-            top: `${deptCCOCenter.top - 53}px`,
-            // 图标水平居中,动态计算偏移
-            left: `${
-              deptCCOCenter.left -
-              (COCOTicketListPage.length * 35 +
-                (COCOTicketListPage.length - 1) * 5) /
-                2 +
-              index * 40
-            }px`,
-          }"
-          :src="require('@/assets/images/table_map2.jpg')"
-          alt=""
-          @click="handleCabinetClick(cabinet)"
-        />
-        <div class="deptXLG">R&R</div>
-        <div class="deptCCO">CCO</div>
+        <!--        <img-->
+        <!--          v-for="(cabinet, index) in COCOTicketListPage"-->
+        <!--          :key="cabinet.cabinetId"-->
+        <!--          :style="{-->
+        <!--            width: '35px',-->
+        <!--            height: '35px',-->
+        <!--            position: 'absolute',-->
+        <!--            cursor: 'pointer',-->
+        <!--            // 图标垂直居中-->
+        <!--            top: `${deptCCOCenter.top - 53}px`,-->
+        <!--            // 图标水平居中,动态计算偏移-->
+        <!--            left: `${-->
+        <!--              deptCCOCenter.left - -->
+        <!--              (COCOTicketListPage.length * 35 +-->
+        <!--                (COCOTicketListPage.length - 1) * 5) /-->
+        <!--                2 +-->
+        <!--              index * 40-->
+        <!--            }px`,-->
+        <!--          }"-->
+        <!--          :src="require('@/assets/images/table_map2.jpg')"-->
+        <!--          alt=""-->
+        <!--          @click="handleCabinetClick(cabinet)"-->
+        <!--        />-->
+        <div class="deptXLG">LD</div>
+        <!--        <div class="deptCCO">CCO</div>-->
       </div>
     </div>
     <!-- 物资列表 -->
-    <div v-if="tabPosition == 'second'" class="materialsListcon">
+    <div v-if="tabPosition == 'second'" class="CabinetListcon">
       <div class="left">
         <!-- 岗位树 -->
         <div class="deptTree">
           <div class="head-container">
             <el-input
-              v-model="queryParamsEare.workstationName"
+              v-model="queryParams.workstationName"
               placeholder="请输入区域名称"
               clearable
               size="small"
               prefix-icon="el-icon-search"
               style="margin-bottom: 20px"
-              @input="handleInputChange"
               @clear="handleClear"
             />
           </div>
@@ -123,7 +122,7 @@
               size="mini"
               @click="handleAdd"
               v-hasPermi="['iscs:cabinet:add']"
-              >新增
+            >新增
             </el-button>
           </el-col>
           <right-toolbar
@@ -133,11 +132,11 @@
         </el-row>
         <el-table
           v-loading="loading"
-          :data="materialsList"
+          :data="CabinetList"
           @selection-change="handleSelectionChange"
         >
-          <el-table-column type="selection" width="55" align="center" />
-          <el-table-column label="物资柜编号" align="center" prop="cabinetCode">
+          <el-table-column type="selection" width="55" align="center"/>
+          <el-table-column label="物资柜编号" align="center" prop="cabinetId">
           </el-table-column>
           <el-table-column
             label="物资柜名称"
@@ -147,12 +146,12 @@
           <el-table-column
             label="物资图片"
             align="center"
-            prop="materialsTypePicture"
+            prop="cabinetPicture"
           >
             <template slot-scope="scope">
               <img
-                v-if="scope.row.materialsTypePicture"
-                :src="scope.row.materialsTypePicture"
+                v-if="scope.row.cabinetPicture"
+                :src="scope.row.cabinetPicture"
                 alt=""
                 style="width: 50px; height: 50px"
               />
@@ -162,26 +161,21 @@
           <el-table-column
             label="物资柜状态"
             align="center"
-            prop="cabinetName"
-          />
+            prop="status"
+          >
+            <template slot-scope="scope">
+              <dict-tag :options="dict.type.cabinet_status" :value="scope.row.status"/>
+            </template>
+          </el-table-column>
 
           <el-table-column label="物资柜详情" align="center">
-            <!-- <template slot-scope="scope">
+            <template slot-scope="scope">
               <el-button
                 v-no-more-click
                 size="mini"
                 type="text"
                 @click="handleLook(scope.row)"
-                >查看
-              </el-button>
-            </template> -->
-            <template>
-              <el-button
-                v-no-more-click
-                size="mini"
-                type="text"
-                @click="handleLook"
-                >查看
+              >查看
               </el-button>
             </template>
           </el-table-column>
@@ -198,7 +192,7 @@
                 icon="el-icon-edit"
                 @click="handleUpdate(scope.row)"
                 v-hasPermi="['iscs:cabinet:edit']"
-                >编辑
+              >编辑
               </el-button>
               <el-button
                 v-no-more-click
@@ -207,21 +201,21 @@
                 icon="el-icon-delete"
                 @click="handleDelete(scope.row)"
                 v-hasPermi="['iscs:cabinet:remove']"
-                >删除
+              >删除
               </el-button>
             </template>
           </el-table-column>
         </el-table>
-        <!-- <pagination
+         <pagination
           v-show="total > 0"
           :total="total"
-          :page.sync="queryParams.pages"
+          :page.sync="queryParams.current"
           :limit.sync="queryParams.size"
           @pagination="getList"
-        /> -->
+        />
       </div>
     </div>
-    <!-- 添加或修改班组对话框 -->
+    <!-- 添加或修改物资柜对话框 -->
     <el-dialog :visible.sync="open" width="510px" append-to-body>
       <div slot="title" class="dialog-title">
         <i></i>
@@ -249,31 +243,24 @@
             placeholder="请输入物资柜名称"
           />
         </el-form-item>
-        <el-form-item label="硬件名称" prop="hardwareId">
-          <el-select
+        <el-form-item label="所属区域" prop="workstationId">
+          <treeselect
             style="width: 348px"
-            v-model="form.hardwareId"
-            placeholder="请选择硬件名称"
-            clearable
-          >
-            <el-option
-              v-for="dict in this.hardWareList"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.value"
-            />
-          </el-select>
+            v-model="form.workstationId"
+            :options="marsOptions"
+            :normalizer="Marsnormalizer"
+            placeholder="选择所属区域"
+          />
+        </el-form-item>
+        <el-form-item label="物资柜图片" prop="cabinetPicture">
+          <ImageUploadSingle
+            :limit="1"
+            :value="form.cabinetPicture"
+            :fileSize="5"
+            @onUploaded="handleIconUplaoded"
+            @onRemoved="handleIconRemoved"
+          ></ImageUploadSingle>
         </el-form-item>
-        <!--        <el-form-item label="工作区域" prop="workareaId">-->
-        <!--          <treeselect-->
-        <!--            style="width: 348px"-->
-        <!--            v-model="form.workareaId"-->
-        <!--            :options="workareaOptions"-->
-        <!--            :normalizer="normalizer"-->
-        <!--            placeholder="选择工作区域"-->
-        <!--          />-->
-        <!--        </el-form-item>-->
-
         <el-form-item label="备注" prop="remark">
           <el-input
             v-model="form.remark"
@@ -282,6 +269,7 @@
             style="width: 348px"
           />
         </el-form-item>
+
       </el-form>
 
       <div slot="footer" class="dialog-footer">
@@ -290,10 +278,10 @@
           type="primary"
           @click="cancel"
           v-if="optType == 'view'"
-          >返回
+        >返回
         </el-button>
         <el-button v-no-more-click type="primary" @click="submitForm" v-else
-          >确 定
+        >确 定
         </el-button>
         <el-button v-no-more-click @click="cancel">取 消</el-button>
       </div>
@@ -307,30 +295,27 @@ import {
   addMaterialsCabinet,
   updateMaterialsCabinet,
   deleteMaterialsCabinet,
-  selectMaterialsCabinetById,
-} from "@/api/mes/material/lockers.js";
+  selectMaterialsCabinetById
+} from '@/api/mes/material/lockers.js'
 
-import { listWorkarea } from "@/api/mes/wa/workarea";
-import { listType } from "@/api/mes/material/typeindex";
-import { listHardware } from "@/api/mes/hw/hardwareinfo";
-import Treeselect from "@riophae/vue-treeselect";
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-import { genCode } from "@/api/system/autocode/rule";
-import { listMarsDept } from "@/api/system/marsdept";
-import { listLoto } from "@/api/mes/lotoStation/lotoStation";
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import { genCode } from '@/api/system/autocode/rule'
+import { listMarsDept } from '@/api/system/marsdept'
+import { listLoto } from '@/api/mes/lotoStation/lotoStation'
 
 export default {
-  name: "Team",
+  name: 'Team',
   components: {
-    Treeselect,
+    Treeselect
   },
-  dicts: ["material_status"],
+  dicts: ['material_status'],
   data() {
     return {
       //自动生成编码
       autoGenFlag: false,
       optType: undefined,
-      tabPosition: "first", //顶部切换
+      tabPosition: 'first', //顶部切换
       // 遮罩层
       loading: true,
       // 选中数组
@@ -345,87 +330,63 @@ export default {
       // 总条数
       total: 0,
       // 班组表格数据
-      materialsList: [],
+      CabinetList: [],
       // 弹出层标题
-      title: "",
+      title: '',
       // 是否显示弹出层
       open: false,
-
       // 查询参数
-      createTime: "",
+      createTime: '',
       queryParams: {
-        pages: 1,
-        size: 10,
-        cabinetCode: null,
-        cabinetName: null,
-      },
-      // 区域岗位查询参数
-      queryParamsEare: {
         current: 1,
         size: 10,
         workstationName: undefined,
-        workstationId: undefined,
-      },
-      hardWareList: [],
-      queryhwParams: {
-        current: 1,
-        size: -1,
-      },
-      // 查询参数
-      queryParamsCabinets: {
-        current: 1,
-        size: -1,
+        workstationId: undefined
       },
+
       pickerOptions: {
         shortcuts: [
           {
-            text: "最近一周",
+            text: '最近一周',
             onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
-              picker.$emit("pick", [start, end]);
-            },
+              const end = new Date()
+              const start = new Date()
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+              picker.$emit('pick', [start, end])
+            }
           },
           {
-            text: "最近一个月",
+            text: '最近一个月',
             onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-              picker.$emit("pick", [start, end]);
-            },
+              const end = new Date()
+              const start = new Date()
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
+              picker.$emit('pick', [start, end])
+            }
           },
           {
-            text: "最近三个月",
+            text: '最近三个月',
             onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
-              picker.$emit("pick", [start, end]);
-            },
-          },
-        ],
+              const end = new Date()
+              const start = new Date()
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
+              picker.$emit('pick', [start, end])
+            }
+          }
+        ]
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
         cabinetCode: [
-          { required: true, message: "物资柜编码不能为空", trigger: "blur" },
+          { required: true, message: '物资柜编码不能为空', trigger: 'blur' }
         ],
         cabinetName: [
-          { required: true, message: "物资柜名称不能为空", trigger: "blur" },
-        ],
-        hardwareId: [
-          {
-            require: true,
-            message: "硬件名称不能为空",
-            trigger: "blur",
-          },
+          { required: true, message: '物资柜名称不能为空', trigger: 'blur' }
         ],
       },
-      workareaOptions: [],
+      marsOptions: [],//岗位
       TicketListPage: [], //R&R岗位
       COCOTicketListPage: [], //CCO岗位
       scaleFactor: 1, // 缩放比例,初始值为1
@@ -433,469 +394,342 @@ export default {
         left: 500,
         top: 260,
         width: 65,
-        height: 25,
+        height: 25
       },
       deptCCOPosition: {
         left: 670,
         top: 480,
         width: 65,
-        height: 25,
+        height: 25
       },
       workstationOptions: [], //岗位
       defaultProps: {
-        children: "children",
-        label: "label",
-      },
-    };
+        children: 'children',
+        label: 'label'
+      }
+    }
   },
   computed: {
     deptXLGCenter() {
       return {
         left: this.deptXLGPosition.left + this.deptXLGPosition.width / 2,
-        top: this.deptXLGPosition.top + this.deptXLGPosition.height / 2,
-      };
+        top: this.deptXLGPosition.top + this.deptXLGPosition.height / 2
+      }
     },
     deptCCOCenter() {
       return {
         left: this.deptCCOPosition.left + this.deptCCOPosition.width / 2,
-        top: this.deptCCOPosition.top + this.deptCCOPosition.height / 2,
-      };
-    },
+        top: this.deptCCOPosition.top + this.deptCCOPosition.height / 2
+      }
+    }
   },
   watch: {
-    "form.workstationId": function (newVal, oldVal) {
-      if (newVal !== oldVal && this.form.lotoId && !this.isEditing) {
-        this.form.lotoId = "";
-      }
+    'queryParams.workstationId': function(newVal, oldVal) {
       if (newVal) {
         const data = {
-          pasge: 1,
+          current: 1,
           size: -1,
-          workstationId: this.form.workstationId,
-        };
-        listLoto(data).then((response) => {
-          this.LotoOptions = response.data.records.map((item) => {
-            return {
-              value: item.lotoId,
-              label: item.lotoName,
-            };
-          });
-        });
+          workstationId: this.queryParams.workstationId
+        }
+        getMaterialsCabinet(data).then((response) => {
+          this.CabinetList = response.data.records
+        })
       }
     },
-    tabPosition: function (newVal, oldVal) {
+    tabPosition: function(newVal, oldVal) {
       if (newVal) {
-        this.getList();
+        this.getList()
       }
-    },
+    }
   },
   created() {
-    this.getList();
-    this.getHardWare();
-    this.getTreeselect();
-    this.getOtherList();
+    this.getList()
+    this.getOtherList()
   },
 
   methods: {
-    // mars岗位树点击事件
-    handleNodeClick(data) {
-      this.queryParams.workstationId = data.id; //这里给查询传递参数
-      this.queryParams.workstationName = data.label; //这里给回显框显示中文
-      const data1 = {
-        pasge: 1,
-        size: -1,
-      };
-      listMarsDept(data1).then((response) => {
-        // 新增岗位单选
-        this.marsOptions = this.handleTree(
-          response.data.records,
-          "workstationId",
-          "parentId"
-        );
-        // mars岗位树数据
-        this.workstationOptions = this.transformToTree(response.data.records);
-        // 使用递归函数查找匹配的节点
-        const selectedTreeNode = this.findNodeById(
-          this.workstationOptions,
-          this.queryParamsEare.workstationId
-        );
-        // 不再递归调用 handleNodeClick
-        if (selectedTreeNode) {
-          // 可以在这里执行其他逻辑,但不要再次调用 handleNodeClick
-          console.log("找到匹配的节点:", selectedTreeNode);
-        } else {
-          console.log("未找到匹配的节点");
-        }
-      });
-      listTechnology(this.queryParamsEare).then((response) => {
-        debugger;
-        let filteredData;
-        if (this.tabPosition == "craft") {
-          filteredData = this.filterByMachineryType(
-            response.data.records,
-            "工艺"
-          );
-          console.log(filteredData, "工艺列表---a");
-        } else {
-          filteredData = this.filterByMachineryType(
-            response.data.records,
-            "设备"
-          );
-          console.log(filteredData, "设备列表---v");
-        }
-
-        this.deptList = this.handleTree(
-          filteredData,
-          "machineryId",
-          "parentId"
-        );
-
-        // 岗位新增的下拉
-        this.machineryOptions = this.handleTree(
-          response.data.records,
-          "machineryId",
-          "parentId"
-        );
-        this.loading = false;
-      });
-    },
-    /** 转换mars岗位数据结构 */
-    Marsnormalizer(node) {
-      if (node.children && !node.children.length) {
-        delete node.children;
-      }
-      return {
-        id: node.workstationId,
-        label: node.workstationName,
-        children: node.children,
-      };
-    },
-    // 筛选节点
-    filterNode(value, data) {
-      if (!value) return true;
-      return data.label.indexOf(value) !== -1;
-    },
-    // mars树形输入框回显监听
-    handleInputChange() {
-      this.$refs.treeData.filter(this.queryParamsEare.workstationId); // 调用树的 filter 方法
-      const data = {
-        page: 1,
-        size: -1,
-        workstationId: null,
-        workstationName: null,
-      };
-      listMarsDept(data).then((response) => {
-        // 新增岗位单选
-        this.marsOptions = this.handleTree(
-          response.data.records,
-          "workstationId",
-          "parentId"
-        );
-        // mars岗位树数据
-        this.workstationOptions = this.transformToTree(response.data.records);
-        // 使用递归函数查找匹配的节点
-        // const selectedTreeNode = this.findNodeById(this.workstationOptions, this.queryParams.workstationId)
-        // 不再递归调用 handleNodeClick
-        // if (selectedTreeNode) {
-        //   // 可以在这里执行其他逻辑,但不要再次调用 handleNodeClick
-        //   console.log('找到匹配的节点:', selectedTreeNode)
-        // } else {
-        //   console.log('未找到匹配的节点')
-        //
-        // }
-      });
-    },
-    // 岗位查询 清除事件
-    handleClear() {
-      this.queryParamsEare.workstationId = "";
-      this.queryParamsEare.workstationName = "";
-      this.getList();
+    /** 查询物资柜信息列表 */
+    getList() {
+      this.loading = true
+      getMaterialsCabinet(this.queryParams).then((response) => {
+        this.CabinetList = response.data.records
+        console.log(response, '所有物资柜')
+        this.TicketListPage = response.data.records.filter((item) => {
+          return item.workstationId == '6'
+        })
+        console.log(this.TicketListPage, 'this.TicketListPage')
+        this.COCOTicketListPage = response.data.records.filter((item) => {
+          return item.workstationId == '7'
+        })
+        this.total = response.data.total
+        this.loading = false
+      })
     },
-
     getOtherList() {
       const data = {
         pasge: 1,
-        size: -1,
-      };
-
-      listLoto(data).then((response) => {
-        this.LotoOptions = response.data.records.map((item) => {
-          return {
-            value: item.lotoId,
-            label: item.lotoName,
-          };
-        });
-      });
-
+        size: -1
+      }
       listMarsDept(data).then((response) => {
         // 新增岗位单选
         this.marsOptions = this.handleTree(
           response.data.records,
-          "workstationId",
-          "parentId"
-        );
+          'workstationId',
+          'parentId'
+        )
         // mars岗位树数据
-        this.workstationOptions = this.transformToTree(response.data.records);
+        this.workstationOptions = this.transformToTree(response.data.records)
         // 使用递归函数查找匹配的节点
         const selectedTreeNode = this.findNodeById(
           this.workstationOptions,
-          this.queryParamsEare.workstationId
-        );
+          this.queryParams.workstationId
+        )
         // 调用 handleNodeClick 方法
         if (selectedTreeNode) {
-          this.handleNodeClick(selectedTreeNode);
+          this.handleNodeClick(selectedTreeNode)
         } else {
-          console.log("未找到匹配的节点");
+          console.log('未找到匹配的节点')
         }
-      });
+      })
+    },
+    // mars岗位树点击事件
+    handleNodeClick(data) {
+      this.queryParams.workstationId = data.id //这里给查询传递参数
+      this.queryParams.workstationName = data.label //这里给回显框显示中文
     },
     /** 转换mars岗位树数据为树形结构 */
     transformToTree(records) {
-      const recordMap = {}; // 创建一个 Map 以存储所有记录
-      const tree = []; // 最终返回的树形结构
+      const recordMap = {} // 创建一个 Map 以存储所有记录
+      const tree = [] // 最终返回的树形结构
 
       // 初始化所有记录到 Map
       records.forEach((record) => {
         recordMap[record.workstationId] = {
           id: record.workstationId,
           label: record.workstationName,
-          children: [],
-        };
-      });
+          children: []
+        }
+      })
 
       // 遍历记录并构建树
       records.forEach((record) => {
-        const parentId = record.parentId;
+        const parentId = record.parentId
 
-        if (parentId === "0") {
+        if (parentId === '0') {
           // 如果是顶层节点,直接添加到树中
-          tree.push(recordMap[record.workstationId]);
+          tree.push(recordMap[record.workstationId])
         } else if (recordMap[parentId]) {
           // 如果有父节点,则将当前节点加入父节点的 children 中
-          recordMap[parentId].children.push(recordMap[record.workstationId]);
+          recordMap[parentId].children.push(recordMap[record.workstationId])
         }
-      });
+      })
 
-      return tree;
+      return tree
     },
-
     // mars岗位数深层次遍历
     findNodeById(nodes, targetId) {
       for (let i = 0; i < nodes.length; i++) {
-        const node = nodes[i];
+        const node = nodes[i]
         if (node.id === targetId) {
-          return node;
+          return node
         }
         if (node.children && node.children.length > 0) {
-          const foundNode = this.findNodeById(node.children, targetId);
+          const foundNode = this.findNodeById(node.children, targetId)
           if (foundNode) {
-            return foundNode;
+            return foundNode
           }
         }
       }
-      return null;
+      return null
     },
-
-    getHardWare() {
-      listHardware(this.queryhwParams).then((response) => {
-        this.hardWareList = response.data.records.map((item) => {
-          return {
-            value: item.id,
-            label: item.hardwareName,
-          };
-        });
-      });
-    },
-
-    /** 查询物资类型下拉树结构 */
-    getTreeselect() {
-      const data = {
-        current: 1,
-        size: 99999,
-      };
-
-      listType(data).then((response) => {
-        this.machinerytypeOptions = this.handleTree(
-          response.data.records,
-          "materialsTypeId",
-          "parentId",
-          "children"
-        );
-      });
-    },
-    // 格式化日期查询数据
-    formatDate(date) {
-      if (date && date instanceof Date && !isNaN(date)) {
-        // 使用本地时间
-        return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(
-          2,
-          "0"
-        )}-${String(date.getDate()).padStart(2, "0")}`;
+    /** 转换mars岗位数据结构 */
+    Marsnormalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children
       }
-      return null;
-    },
-    /** 查询物资信息列表 */
-    getList() {
-      this.loading = true;
-      // 格式化日期并更新 queryParams
-      if (Array.isArray(this.createTime) && this.createTime.length === 2) {
-        this.queryParams.startTime = this.formatDate(this.createTime[0]);
-        this.queryParams.endTime = this.formatDate(this.createTime[1]);
+      return {
+        id: node.workstationId,
+        label: node.workstationName,
+        children: node.children
       }
-      getMaterialsCabinet(this.queryParams).then((response) => {
-        this.materialsList = response.data.records;
-        console.log(response, "所有物资柜");
-        this.TicketListPage = response.data.records.filter((item) => {
-          return item.workstationId == "8";
-        });
-        this.COCOTicketListPage = response.data.records.filter((item) => {
-          return item.workstationId == "7";
-        });
-        this.total = response.data.total;
-        this.machinerytypeList = this.handleTree(
-          response.data.records,
-          "cabinetId",
-          "parentId",
-          "children"
-        );
-        this.loading = false;
-      });
     },
+    // 筛选节点
+    filterNode(value, data) {
+      if (!value) return true
+      return data.label.indexOf(value) !== -1
+    },
+    // 岗位查询 清除事件
+    handleClear() {
+      this.queryParams.workstationId = ''
+      this.queryParams.workstationName = ''
+      this.getList()
+    },
+
     // 物资柜跳转详情
     handleCabinetClick(cabinet) {
-      console.log(cabinet, "详情拿到的");
+      this.$router.push({ path:'/mes/material/lockers/DetailsIndex',query:{cabinetId:cabinet.cabinetId,cabinetName:cabinet.cabinetName} })
+      console.log(cabinet, '地图跳转详情拿到的')
     },
     // 物资柜列表跳转详情
-    handleLook() {
-      this.$router.push("/mes/material/lockers/DetailsIndex");
-
-      console.log("详情tiaozhuan");
+    handleLook(row) {
+      this.$router.push({ path:'/mes/material/lockers/DetailsIndex',query:{cabinetId:row.cabinetId,cabinetName:row.cabinetName} })
+      console.log('列表详情')
     },
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.reset();
+      this.open = false
+      this.reset()
     },
     // 表单重置
     reset() {
       this.form = {
-        cabinetCode: "",
-        cabinetName: "",
-      };
-      this.resetForm("form");
-      this.autoGenFlag = false;
+        cabinetCode: '',
+        cabinetName: '',
+        workstationId: '',
+        remark:'',
+        cabinetPicture: '',
+      }
+      this.resetForm('form')
+      this.autoGenFlag = false
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pages = 1;
-      this.getList();
+      this.queryParams.current = 1
+      this.getList()
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.createTime = "";
-      this.queryParams.cabinetCode = null;
-      this.queryParams.cabinetName = null;
-      this.resetForm("queryForm");
-      this.handleQuery();
+      this.createTime = ''
+      this.queryParams.cabinetCode = null
+      this.queryParams.cabinetName = null
+      this.resetForm('queryForm')
+      this.handleQuery()
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.cabinetId);
-      this.codes = selection.map((item) => item.cabinetCode);
-      this.single = selection.length !== 1;
-      this.multiple = !selection.length;
+      this.ids = selection.map((item) => item.cabinetId)
+      this.codes = selection.map((item) => item.cabinetCode)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
     },
 
     /** 新增按钮操作 */
     handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "新增物资柜信息";
-      this.optType = "add";
+      this.reset()
+      this.open = true
+      this.title = '新增物资柜信息'
+      this.optType = 'add'
     },
 
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset();
+      this.reset()
       selectMaterialsCabinetById(row.cabinetId).then((response) => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "编辑物资柜信息";
-        this.optType = "edit";
-      });
+        this.form = response.data
+        this.open = true
+        this.title = '编辑物资柜信息'
+        this.optType = 'edit'
+      })
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate((valid) => {
+      this.$refs['form'].validate((valid) => {
         if (valid) {
           if (this.form.cabinetId != null) {
             updateMaterialsCabinet(this.form).then((response) => {
-              console.log(response, "修改返回");
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
+              console.log(response, '修改返回')
+              this.$modal.msgSuccess('修改成功')
+              this.open = false
+              this.getList()
+            })
           } else {
             addMaterialsCabinet(this.form).then((response) => {
-              console.log(response, "新增返回");
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
+              console.log(response, '新增返回')
+              this.$modal.msgSuccess('新增成功')
+              this.open = false
+              this.getList()
+            })
           }
         }
-      });
+      })
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const cabinetIds = row.cabinetId || this.ids;
-      const cabinetCodes = row.cabinetCode || this.codes;
+      const cabinetIds = row.cabinetId || this.ids
+      const cabinetCodes = row.cabinetCode || this.codes
       this.$modal
         .confirm('是否确认删除编号为"' + cabinetCodes + '"的数据项?')
-        .then(function () {
-          return deleteMaterialsCabinet(cabinetIds);
+        .then(function() {
+          return deleteMaterialsCabinet(cabinetIds)
         })
         .then(() => {
-          this.getList();
-          this.$modal.msgSuccess("删除成功");
+          this.getList()
+          this.$modal.msgSuccess('删除成功')
+        })
+        .catch(() => {
         })
-        .catch(() => {});
     },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download(
-        "cal/team/export",
-        {
-          ...this.queryParams,
-        },
-        `team_${new Date().getTime()}.xlsx`
-      );
+    //图标上传成功
+    handleIconUplaoded(imgUrl) {
+      this.form.cabinetPicture = imgUrl[0].url
+    },
+    // 图标移除
+    handleIconRemoved(imgUrl) {
+      this.form.cabinetPicture = null
     },
-
     //自动生成编码
     handleAutoGenChange(autoGenFlag) {
       if (autoGenFlag) {
-        genCode("MATERIALS_CABINET").then((response) => {
-          this.form.cabinetCode = response;
-        });
+        genCode('MATERIALS_CABINET').then((response) => {
+          this.form.cabinetCode = response
+        })
       } else {
-        this.form.cabinetCode = null;
+        this.form.cabinetCode = null
       }
-    },
-  },
-};
+    }
+  }
+}
 </script>
 <style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
 </style>
 <style scoped lang="scss">
+.deptXLG {
+  position: absolute;
+  width: 65px;
+  height: 25px;
+  left: 500px;
+  top: 260px;
+  background: #70b26f;
+  line-height: 25px;
+  text-align: center;
+  border-radius: 5px;
+  color: #fff;
+  cursor: pointer;
+}
+
+.deptCCO {
+  position: absolute;
+  width: 65px;
+  height: 25px;
+  left: 670px;
+  top: 480px;
+  background: #70b26f;
+  line-height: 25px;
+  text-align: center;
+  border-radius: 5px;
+  color: #fff;
+  cursor: pointer;
+}
+
 .el-input-width {
   width: 380px !important;
 }
+
 .app-container {
   width: 100%;
   height: 100%;
   // background: green;
-  .materialsListcon {
+  .CabinetListcon {
     width: 100%;
     height: 100%;
     display: flex;

+ 19 - 12
src/views/mes/material/materialinformation/index.vue

@@ -55,7 +55,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item  label="有效期" prop="">
+      <el-form-item label="有效期截至" prop="">
         <el-date-picker
           style="width: 215px"
           :default-time="['00:00:00', '23:59:59']"
@@ -439,6 +439,12 @@ export default {
     Template,
     Treeselect
   },
+  props: {
+    cabinetId: {
+      type: String,
+      required: true
+    }
+  },
   dicts: ['material_status'],
   data() {
     return {
@@ -472,7 +478,7 @@ export default {
         size: 10,
         materialsCode: null,
         materialsName: null,
-        materialsRfid:null,
+        materialsRfid: null,
         loanState: null,
         materialsCabinetId: null,
         materialsTypeId: null,
@@ -549,9 +555,11 @@ export default {
       },
 
       machinerytypeOptions: []
+
     }
   },
   created() {
+    this.queryParams.materialsCabinetId = this.cabinetId
     this.getList()
     this.getTreeselect()
   },
@@ -559,7 +567,6 @@ export default {
     this.materialsCabinets()
   },
   methods: {
-
     /** 转换数据结构 */
     normalizer(node) {
       if (node.children && !node.children.length) {
@@ -591,15 +598,15 @@ export default {
     formatDate(date) {
       if (date && date instanceof Date && !isNaN(date)) {
         // 使用本地时间
-        const year = date.getFullYear();
-        const month = String(date.getMonth() + 1).padStart(2, '0');
-        const day = String(date.getDate()).padStart(2, '0');
-        const hours = String(date.getHours()).padStart(2, '0');
-        const minutes = String(date.getMinutes()).padStart(2, '0');
-        const seconds = String(date.getSeconds()).padStart(2, '0');
-        return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+        const year = date.getFullYear()
+        const month = String(date.getMonth() + 1).padStart(2, '0')
+        const day = String(date.getDate()).padStart(2, '0')
+        const hours = String(date.getHours()).padStart(2, '0')
+        const minutes = String(date.getMinutes()).padStart(2, '0')
+        const seconds = String(date.getSeconds()).padStart(2, '0')
+        return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
       }
-      return null;
+      return null
     },
     /** 查询物资信息列表 */
     getList() {
@@ -645,7 +652,7 @@ export default {
         materialsTypeId: '',
         materialsCabinetId: '',
         expirationDate: '',
-        supplier: '',
+        supplier: ''
       }
       this.resetForm('form')
       this.autoGenFlag = false

+ 128 - 99
src/views/mes/material/replacementrecords/index.vue

@@ -8,12 +8,11 @@
       v-show="showSearch"
       label-width="100px"
     >
-      <el-form-item label="物资柜" prop="cabinetIdStr">
+      <el-form-item label="物资柜" prop="cabinetId">
         <el-select
           style="width: 208px"
-          v-model="queryParams.cabinetIdStr"
+          v-model="queryParams.cabinetId"
           placeholder="请选择物资柜"
-          multiple
           clearable
         >
           <el-option
@@ -33,10 +32,10 @@
           placeholder="请选择物资类型"
         />
       </el-form-item>
-      <el-form-item label="更换人" prop="materialsCode">
+      <el-form-item label="更换人" prop="changeUserName">
         <el-input
-          v-model="queryParams.materialsCode"
-          placeholder="请输入检查员"
+          v-model="queryParams.changeUserName"
+          placeholder="请输入更换人"
           clearable
           @keyup.enter.native="handleQuery"
         />
@@ -45,7 +44,7 @@
         <el-date-picker
           style="width: 215px"
           :default-time="['00:00:00', '23:59:59']"
-          v-model="restitutionTime"
+          v-model="createTime"
           type="datetimerange"
           :picker-options="pickerOptions"
           range-separator="-"
@@ -55,34 +54,34 @@
         >
         </el-date-picker>
       </el-form-item>
-      <el-form-item label="原物资编号" prop="materialsName">
+      <el-form-item label="原物资编号" prop="oldMaterialsId">
         <el-input
-          v-model="queryParams.materialsName"
+          v-model="queryParams.oldMaterialsId"
           placeholder="请输入原物资编号"
           clearable
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="原RFID" prop="materialsName">
+      <el-form-item label="原RFID" prop="oldMaterialsRfid">
         <el-input
-          v-model="queryParams.materialsName"
-          placeholder="请输入原物资编号"
+          v-model="queryParams.oldMaterialsRfid"
+          placeholder="请输入原RFID"
           clearable
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="新物资编号" prop="materialsName">
+      <el-form-item label="新物资编号" prop="newMaterialsId">
         <el-input
-          v-model="queryParams.materialsName"
-          placeholder="请输入物资编号"
+          v-model="queryParams.newMaterialsId"
+          placeholder="请输入物资编号"
           clearable
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="新RFID" prop="materialsName">
+      <el-form-item label="新RFID" prop="newMaterialsRfid">
         <el-input
-          v-model="queryParams.materialsName"
-          placeholder="请输入原物资编号"
+          v-model="queryParams.newMaterialsRfid"
+          placeholder="请输入新RFID"
           clearable
           @keyup.enter.native="handleQuery"
         />
@@ -108,42 +107,42 @@
         >
       </el-form-item>
     </el-form>
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          v-no-more-click
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['iscs:change:add']"
-        >新增
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          v-no-more-click
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['iscs:change:remove']"
-        >批量删除
-        </el-button>
-      </el-col>
-    </el-row>
+<!--    <el-row :gutter="10" class="mb8">-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          v-no-more-click-->
+<!--          type="primary"-->
+<!--          plain-->
+<!--          icon="el-icon-plus"-->
+<!--          size="mini"-->
+<!--          @click="handleAdd"-->
+<!--          v-hasPermi="['iscs:change:add']"-->
+<!--        >新增-->
+<!--        </el-button>-->
+<!--      </el-col>-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          v-no-more-click-->
+<!--          type="danger"-->
+<!--          plain-->
+<!--          icon="el-icon-delete"-->
+<!--          size="mini"-->
+<!--          :disabled="multiple"-->
+<!--          @click="handleDelete"-->
+<!--          v-hasPermi="['iscs:change:remove']"-->
+<!--        >批量删除-->
+<!--        </el-button>-->
+<!--      </el-col>-->
+<!--    </el-row>-->
     <el-table
       v-loading="loading"
       :data="changeRecordList"
       @selection-change="handleSelectionChange"
     >
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="物资柜" align="center" prop="checkName">
+      <el-table-column label="物资柜" align="center" prop="cabinetName">
       </el-table-column>
-      <el-table-column label="物资名称" align="center" prop="materialsName" />
+<!--      <el-table-column label="物资名称" align="center" prop="materialsName" />-->
       <el-table-column label="物资类型" align="center" prop="materialsTypeName" />
       <el-table-column
         label="物资图片"
@@ -160,57 +159,55 @@
           <span v-else>-</span>
         </template>
       </el-table-column>
-      <el-table-column label="原物资编号" align="center" prop="materialsId">
+      <el-table-column label="原物资编号" align="center" prop="oldMaterialsId">
       </el-table-column>
-      <el-table-column label="原RFID" align="center" prop="RFID">
+      <el-table-column label="原RFID" align="center" prop="oldMaterialsRfid">
       </el-table-column>
-      <el-table-column label="新物资编号" align="center" prop="materialsId">
+      <el-table-column label="新物资编号" align="center" prop="newMaterialsId">
       </el-table-column>
-      <el-table-column label="新RFID" align="center" prop="RFID">
+      <el-table-column label="新RFID" align="center" prop="newMaterialsRfid">
       </el-table-column>
       <el-table-column
         label="更换人"
         align="center"
-        prop="cron"
+        prop="changeUserName"
       >
       </el-table-column>
-      <el-table-column label="更换时间" align="center" prop="status">
-        <template slot-scope="scope">
-          <el-button type="text" @click="goto">查看</el-button>
-        </template>
-      </el-table-column>
-      <el-table-column
-        label="操作"
-        align="center"
-        class-name="small-padding fixed-width"
-      >
-        <template slot-scope="scope">
-          <el-button
-            v-no-more-click
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['iscs:change:edit']"
-          >编辑
-          </el-button>
+      <el-table-column label="更换时间" align="center" prop="changeDate">
 
-          <el-button
-            v-no-more-click
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['iscs:change:remove']"
-          >删除
-          </el-button>
-        </template>
       </el-table-column>
+<!--      <el-table-column-->
+<!--        label="操作"-->
+<!--        align="center"-->
+<!--        class-name="small-padding fixed-width"-->
+<!--      >-->
+<!--        <template slot-scope="scope">-->
+<!--          <el-button-->
+<!--            v-no-more-click-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-edit"-->
+<!--            @click="handleUpdate(scope.row)"-->
+<!--            v-hasPermi="['iscs:change:edit']"-->
+<!--          >编辑-->
+<!--          </el-button>-->
+
+<!--          <el-button-->
+<!--            v-no-more-click-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-delete"-->
+<!--            @click="handleDelete(scope.row)"-->
+<!--            v-hasPermi="['iscs:change:remove']"-->
+<!--          >删除-->
+<!--          </el-button>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
     </el-table>
     <pagination
       v-show="total > 0"
       :total="total"
-      :page.sync="queryParams.pages"
+      :page.sync="queryParams.current"
       :limit.sync="queryParams.size"
       @pagination="getList"
     />
@@ -282,20 +279,20 @@
             />
           </el-select>
         </el-form-item>
-        <el-form-item label="检查记录Id" prop="recordId">
+        <el-form-item label="检查记录Id" prop="checkRecordId">
           <el-input
-            v-model="form.recordId"
+            v-model="form.checkRecordId"
             placeholder="请输入检查记录Id"
             clearable
           />
         </el-form-item>
-        <el-form-item label="物资Id" prop="materialsId">
-          <el-input
-            v-model="form.materialsId"
-            placeholder="请输入物资Id"
-            clearable
-          />
-        </el-form-item>
+<!--        <el-form-item label="物资Id" prop="materialsId">-->
+<!--          <el-input-->
+<!--            v-model="form.materialsId"-->
+<!--            placeholder="请输入物资Id"-->
+<!--            clearable-->
+<!--          />-->
+<!--        </el-form-item>-->
         <el-form-item label="新物资Id" prop="newMaterialsId">
           <el-input
             v-model="form.newMaterialsId"
@@ -352,6 +349,12 @@ import { listPlan } from '@/api/mes/material/plan'
 export default {
   name: 'Team',
   components: { Template, Treeselect },
+  props:{
+    cabinetId:{
+      type:String,
+      required:true
+    }
+  },
   dicts: ['material_status','checking_status'],
   data() {
     return {
@@ -380,16 +383,20 @@ export default {
       // 查询参数
       createTime: '',
       queryParams: {
-        pages: 1,
+        current: 1,
         size: 10,
-        materialsCode: null,
-        materialsName: null,
-        loanState: null,
         materialsCabinetId: null,
         materialsTypeId: null,
         startTime: '',
-        endTime: ''
+        endTime: '',
+        oldMaterialsId:'',
+        oldMaterialsRfid:'',
+        newMaterialsId:'',
+        newMaterialsRfid:'',
+        changeUserName:'',
+        recordId:''
       },
+      title:'',
       // 表单参数
       form: {},
       cabinets: [], //物资所属柜
@@ -442,14 +449,25 @@ export default {
       materialstypeOptions:[],
     }
   },
+
   created() {
+    this.queryParams.cabinetId = this.cabinetId
     this.getList()
     this.getTreeselect()
     this.materialsCabinets()
   },
 
   methods: {
+    formatDate(date) {
+      const year = date.getFullYear().toString().padStart(2, "0");
+      const month = (date.getMonth() + 1).toString().padStart(2, "0");
+      const day = date.getDate().toString().padStart(2, "0");
+      const hours = date.getHours().toString().padStart(2, "0");
+      const minutes = date.getMinutes().toString().padStart(2, "0");
+      const seconds = date.getSeconds().toString().padStart(2, "0");
 
+      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+    },
     /** 查询物资信息列表 */
     getList() {
       this.loading = true
@@ -458,7 +476,11 @@ export default {
         this.queryParams.startTime = this.formatDate(this.createTime[0])
         this.queryParams.endTime = this.formatDate(this.createTime[1])
       }
-      listChangeRecord(this.queryParams).then((response) => {
+      const data={
+        ...this.queryParams,
+        recordId:this.$route.query.recordId
+      }
+      listChangeRecord(data).then((response) => {
         console.log(response, '获取物资信息allList ')
         this.changeRecordList = response.data.records
         this.total = response.data.total
@@ -544,7 +566,11 @@ export default {
         children: node.children
       }
     },
-
+// 取消按钮
+    cancel() {
+      this.open = false
+      this.reset()
+    },
     // 表单重置
     reset() {
       this.form = {
@@ -561,6 +587,9 @@ export default {
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm('queryForm')
+      this.queryParams.startTime = ''
+      this.queryParams.endTime = ''
+      this.createTime=''
       this.handleQuery()
     },
     // 多选框选中数据

+ 1 - 0
src/views/system/user/index.vue

@@ -170,6 +170,7 @@
           <el-table-column label="工号" align="center" key="userName" prop="userName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
           <el-table-column label="单位" align="center" key="unitName" prop="unitName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
           <el-table-column label="角色" align="center" key="roleName" prop="roleName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
+          <el-table-column label="邮件" align="center" key="email" prop="email" v-if="columns[2].visible"  width="180"/>
           <el-table-column label="岗位" align="center" key="workstationName" prop="workstationName" v-if="columns[2].visible" :show-overflow-tooltip="true" >
             <template slot-scope="scope">
               <el-button type="text" @click="HandleLookWorkStation(scope.row)">查看</el-button>