Explorar el Código

2025/1/26日早上代码提交,修复部分bug仍有部分内容需新增

pm hace 9 meses
padre
commit
b2bcfb88aa

+ 2 - 2
src/api/mes/email/notify.js

@@ -23,7 +23,7 @@ export function addIsMailNotifyConfig(data) {
 // 删除系统邮件提醒周期配置  ​/dev-api​/iscs​/notify​/deleteIsMailNotifyConfigByConfigIds
 export function deleteIsMailNotifyConfig(data) {
     return request({
-        url: '/iscs/notify/deleteIsMailNotifyConfigByConfigIds?configIds=' + configIds,
+        url: '/iscs/notify/deleteIsMailNotifyConfigByConfigIds?configIds=' + data,
         method: 'post',
     })
 }
@@ -45,4 +45,4 @@ export function getIsMailNotifyConfigById(configId) {
         url: '/iscs/notify/selectIsMailNotifyConfigById?configId=' + configId,
         method: 'get',
     })
-}
+}

+ 19 - 11
src/views/mes/email/emailNotify/index.vue

@@ -7,18 +7,18 @@
       :inline="true"
       v-show="showSearch"
     >
-      <el-form-item label="标题" prop="name">
+      <el-form-item label="提醒事项" prop="name">
         <el-input
           v-model="queryParams.name"
-          placeholder="请输入名称"
+          placeholder="请输入提醒事项"
           clearable
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="内容" prop="content">
+      <el-form-item label="邮件模板" prop="templateName">
         <el-input
-          v-model="queryParams.content"
-          placeholder="请输入内容"
+          v-model="queryParams.templateName"
+          placeholder="请输入邮件模板"
           clearable
           @keyup.enter.native="handleQuery"
         />
@@ -113,6 +113,15 @@
             v-hasPermi="['iscs:notify:edit']"
             >编辑
           </el-button>
+          <el-button
+            v-no-more-click
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['iscs:notify:remove']"
+          >删除
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -219,7 +228,7 @@ export default {
         current: 1,
         size: 10,
         name: "",
-        content: "",
+        templateName: "",
       },
       isEdit: false,
       // 表单参数
@@ -319,9 +328,8 @@ export default {
     // 表单重置
     reset() {
       this.form = {
-        sopId: undefined,
-        parentId: undefined,
-        sopName: undefined,
+        name: undefined,
+        templateName: undefined,
       };
       this.autoGenFlag = false;
       // 重置所有时间值
@@ -344,7 +352,7 @@ export default {
     /** 重置按钮操作 */
     resetQuery() {
       this.queryParams.name = "";
-      this.queryParams.content = "";
+      this.queryParams.templateName = "";
       this.resetForm("queryForm");
       this.handleQuery();
     },
@@ -423,7 +431,7 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const templateCodes = row.conifgId || this.codes;
+      const templateCodes = row.configId || this.codes;
       this.$modal
         .confirm('是否确认删除名称为"' + templateCodes + '"的数据项?')
         .then(function () {

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

@@ -7,18 +7,18 @@
       :inline="true"
       v-show="showSearch"
     >
-      <el-form-item label="名称" prop="templateName">
+      <el-form-item label="邮件模板名称" prop="templateName">
         <el-input
           v-model="queryParams.templateName"
-          placeholder="请输入名称"
+          placeholder="请输入邮件模板名称"
           clearable
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="内容" prop="templateContent">
+      <el-form-item label="邮件模板标题" prop="templateTitle">
         <el-input
-          v-model="queryParams.templateContent"
-          placeholder="请输入内容"
+          v-model="queryParams.templateTitle"
+          placeholder="请输入邮件模板标题"
           clearable
           @keyup.enter.native="handleQuery"
         />
@@ -224,8 +224,8 @@ export default {
       queryParams: {
         current: 1,
         size: 10,
-        name: "",
-        content: "",
+        templateName: "",
+        templateTitle: "",
       },
       isEdit: false,
       // 表单参数
@@ -270,9 +270,9 @@ export default {
     // 表单重置
     reset() {
       this.form = {
-        sopId: undefined,
-        parentId: undefined,
-        sopName: undefined,
+        templateName: undefined,
+        templateTitle: undefined,
+        templateContent: undefined,
       };
       this.autoGenFlag = false;
       this.resetForm("form");
@@ -285,8 +285,8 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.queryParams.name = "";
-      this.queryParams.content = "";
+      this.queryParams.templateName = "";
+      this.queryParams.templateTitle = "";
       this.resetForm("queryForm");
       this.handleQuery();
     },

+ 162 - 263
src/views/mes/material/Inspectionrecords/index.vue

@@ -71,15 +71,15 @@
         >
         </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="workstationId">-->
+      <!--        <treeselect-->
+      <!--          style="width: 218px"-->
+      <!--          v-model="queryParams.workstationId"-->
+      <!--          :options="marsOptions"-->
+      <!--          :normalizer="normalizer"-->
+      <!--          placeholder="选择岗位"-->
+      <!--        />-->
+      <!--      </el-form-item>-->
 
 
       <el-form-item label="状态" prop="status">
@@ -130,32 +130,33 @@
                  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>-->
+      >导出
+      </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"
@@ -166,18 +167,18 @@
       :data="RecordList"
       @selection-change="handleSelectionChange"
     >
-      <el-table-column type="selection" width="55" align="center"/>
+      <!--      <el-table-column type="selection" width="55" align="center"/>-->
       <el-table-column label="计划名称" align="center" prop="planName" width="200">
         <template slot-scope="scope">
-          {{scope.row.planName}}
+          {{ scope.row.planName }}
         </template>
       </el-table-column>
       <el-table-column label="物资柜" align="center" prop="cabinetName">
       </el-table-column>
       <el-table-column label="物资编号" align="center" prop="materialsId">
       </el-table-column>
-      <el-table-column label="物资名称" align="center" prop="materialsName" />
-      <el-table-column label="物资类型" align="center" prop="materialsTypeName" />
+      <el-table-column label="物资名称" align="center" prop="materialsName"/>
+      <el-table-column label="物资类型" align="center" prop="materialsTypeName"/>
       <el-table-column
         label="物资图片"
         align="center"
@@ -220,33 +221,33 @@
           <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-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-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"
@@ -255,124 +256,13 @@
       :limit.sync="queryParams.size"
       @pagination="getList"
     />
-    <!-- 添加或修改班组对话框 -->
-    <el-dialog :visible.sync="open" width="500px" append-to-body>
-      <div slot="title" class="dialog-title">
-        <i></i>
-        <span class="title">{{ title }}</span>
-      </div>
-      <el-form ref="form" :model="form" :rules="rules" label-width="110px">
-        <el-form-item label="计划名称Id" prop="planId">
-          <el-select
-            style="width: 348px"
-            v-model="form.planId"
-            placeholder="请选择检查计划"
-            clearable
-          >
-            <el-option
-              v-for="dict in planList"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.value"
-            />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="更换日期">
-          <el-date-picker
-            style="width: 350px"
-            v-model="form.changeDate"
-            placeholder="请选择日期"
-            :picker-options="pickerOptions"
-            align="right"
-          >
-          </el-date-picker>
-        </el-form-item>
-<!--        <el-form-item label="所属岗位" prop="workstationId">-->
-<!--          <treeselect  style="width: 348px" v-model="form.workstationId" :options="workstationOption"-->
-<!--                       :normalizer="normalizer" placeholder="选择岗位"-->
-<!--          />-->
-<!--        </el-form-item>-->
-<!--        <el-form-item label="检查物资柜" prop="cabinetIds">-->
-<!--          <el-select-->
-<!--            style="width: 348px"-->
-<!--            v-model="form.cabinetIds"-->
-<!--            placeholder="请选择需要检查的物资柜"-->
-<!--            multiple-->
-<!--            clearable-->
-<!--          >-->
-<!--            <el-option-->
-<!--              v-for="dict in cabinets"-->
-<!--              :key="dict.value"-->
-<!--              :label="dict.label"-->
-<!--              :value="dict.value"-->
-<!--            />-->
-<!--          </el-select>-->
-<!--        </el-form-item>-->
-        <el-form-item label="更换员" prop="changeUserId">
-          <el-select
-            style="width: 348px"
-            v-model="form.changeUserId"
-            placeholder="请选择更换员"
-            clearable
-          >
-            <el-option
-              v-for="dict in planPersonOption"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.value"
-            />
-          </el-select>
-        </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"
-            placeholder="请输入新物资Id"
-            clearable
-          />
-        </el-form-item>
-        <el-form-item label="新物资RFID" prop="newMaterialsRfid">
-          <el-input
-            v-model="form.newMaterialsRfid"
-            placeholder="请输入新物资RFID"
-            clearable
-          />
-        </el-form-item>
-        <el-form-item label="原物资Id" prop="oldMaterialsId">
-          <el-input
-            v-model="form.oldMaterialsId"
-            placeholder="请输入原物资Id"
-            clearable
-          />
-        </el-form-item>
-        <el-form-item label="原物资Rfid" prop="oldMaterialsRfid">
-          <el-input
-            v-model="form.oldMaterialsRfid"
-            placeholder="请输入原物资Rfid"
-            clearable
-          />
-        </el-form-item>
-      </el-form>
 
-      <div slot="footer" class="dialog-footer">
-        <el-button v-no-more-click type="primary" @click="submitForm"
-        >确 定
-        </el-button>
-        <el-button v-no-more-click @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
   </div>
 </template>
 
 <script>
 import {
-  listCheckRecord,addCheckRecord,updateCheckRecord,deleteCheckRecord,selectCheckRecordById
+  listCheckRecord, addCheckRecord, updateCheckRecord, deleteCheckRecord, selectCheckRecordById
 } from '@/api/mes/material/checkRecord'
 import Treeselect from '@riophae/vue-treeselect'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@@ -386,21 +276,21 @@ import { listPlan } from '@/api/mes/material/plan'
 export default {
   name: 'Team',
   components: { Template, Treeselect },
-  props:{
-    cabinetId:{
-      type:String,
-      required:false
+  props: {
+    cabinetId: {
+      type: String,
+      required: false
     },
-    planId:{
-      type:String,
-      required:false
+    planId: {
+      type: String,
+      required: false
+    },
+    planName: {
+      type: String,
+      required: false
     },
-    planName:{
-      type:String,
-      required:false
-    }
   },
-  dicts: ['material_status','checks_status','exceptions_status'],
+  dicts: ['material_status', 'checks_status', 'exceptions_status'],
   data() {
     return {
       //自动生成编码
@@ -432,24 +322,24 @@ export default {
       queryParams: {
         current: 1,
         size: 10,
-        materialsRfid:'',
+        materialsRfid: '',
         materialsName: null,
         loanState: null,
         materialsCabinetId: null,
         materialsTypeId: null,
         startTime: '',
         endTime: '',
-        reason:'',
-        status:'',
-        planId:null,
-        planName:'',
-        cabinetId:null,
+        reason: '',
+        status: '',
+        planId: null,
+        planName: '',
+        cabinetId: null
       },
       // 表单参数
       form: {},
       cabinets: [], //物资所属柜
       planPersonOption: [], // 检查人员
-      planList:[],//检查计划Id
+      planList: [],//检查计划Id
       workstationOption: [],//所属岗位
       // 表单校验
       rules: {
@@ -467,92 +357,111 @@ export default {
       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])
+            }
+          }
+        ]
       },
-      materialstypeOptions:[],
-      visibleSelect:false,
+      materialstypeOptions: [],
+      visibleSelect: false
     }
   },
+
   created() {
     this.getList()
     this.getTreeselect()
     this.materialsCabinets()
 
-    this.queryParams.planName = this.$route.query.planName || this.planName||null;
-    this.queryParams.cabinetId = this.$route.query.cabinetId ||this.cabinetId||null;
-    if(this.cabinetId){
-      this.visibleSelect=true
-
+    console.log(this.planId, this.planName, '接收到了 生活时尚生活是')
+    if (this.cabinetId) {
+      this.visibleSelect = true
     }
-
   },
 
   methods: {
-
-    goto(row){
-      if(this.cabinetId){
-        this.$emit('recordId',row.recordId);
-      }else{
+    goto(row) {
+      if (this.cabinetId) {
+        this.$emit('recordId', row.recordId)
+      } else {
         this.$router.push({
-          path:'/material/replacementrecords',
-          query:{
-            recordId:row.recordId,
+          path: '/material/replacementrecords',
+          query: {
+            recordId: row.recordId
           }
         })
       }
 
     },
     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");
+      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}`;
+      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
     },
     /** 查询物资信息列表 */
     getList() {
       this.loading = true
+      this.queryParams.planName = null
+      this.queryParams.cabinetId = null
+      this.queryParams.planId = null
       // 格式化日期并更新 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])
       }
-      const data={
-        ...this.queryParams,
-        cabinetId:this.cabinetId,
-        planId:this.$route.query.planId||this.planId,
+      // 更新 queryParams 从路由查询参数
+      if (this.$route.query.planName) {
+        this.queryParams.planName = this.$route.query.planName
+      }
+      if (this.$route.query.planId) {
+        this.queryParams.planId = this.$route.query.planId
+      }
+      // 更新 queryParams 从 props
+      if (this.planName) {
+        this.queryParams.planName = this.planName
+      }
+      if (this.planId) {
+        this.queryParams.planId = this.planId
+      }
+
+      if (this.$route.query.cabinetId) {
+        this.queryParams.cabinetId = this.$route.query.cabinetId
+      }
+      if (this.cabinetId) {
+        this.queryParams.cabinetId = this.cabinetId
+      }
+      const data = {
+        ...this.queryParams
       }
       listCheckRecord(data).then((response) => {
-        console.log(response,'response')
+        console.log(response, 'response')
         this.RecordList = response.data.records
 
         this.total = response.data.total
@@ -567,7 +476,7 @@ export default {
         size: -1
       }
       listType(data).then((response) => {
-        console.log(response,'物资类型树形结构')
+        console.log(response, '物资类型树形结构')
         this.materialstypeOptions = this.handleTree(
           response.data.records,
           'materialsTypeId',
@@ -580,7 +489,7 @@ export default {
     materialsCabinets() {
       const data2 = {
         current: 1,
-        size: -1,
+        size: -1
       }
       getIsMaterialsCabinets(data2).then((response) => {
         if (response?.data?.records) {
@@ -595,10 +504,10 @@ export default {
       const data3 = {
         pasge: 1,
         size: -1,
-        parentId:'0'
+        parentId: '0'
       }
       listMarsDept(data3).then((response) => {
-        this.marsOptions = this.handleTree(response.data.records,"workstationId","parentId")
+        this.marsOptions = this.handleTree(response.data.records, 'workstationId', 'parentId')
       })
       const data1 = {
         pageSize: 999999999,
@@ -616,7 +525,7 @@ export default {
         this.planList = response.data.records.map((item) => {
           return {
             label: item.planName,
-            value: item.planId,
+            value: item.planId
           }
         })
       })
@@ -651,17 +560,7 @@ export default {
     },
     // 表单重置
     reset() {
-      this.form = {
-        changeDate:'',
-        changeUserId:'',
-        checkUserName:'',
-        materialsId:'',
-        newMaterialsId:'',
-        newMaterialsRfid:'',
-        oldMaterialsId:'',
-        oldMaterialsRfid:'',
-        planId:''
-      }
+
       this.resetForm('form')
       this.autoGenFlag = false
     },
@@ -675,7 +574,7 @@ export default {
       this.resetForm('queryForm')
       this.queryParams.startTime = ''
       this.queryParams.endTime = ''
-      this.createTime=''
+      this.createTime = ''
       this.handleQuery()
     },
     // 多选框选中数据
@@ -689,7 +588,7 @@ export default {
     handleAdd() {
       this.reset()
       this.open = true
-      this.form.workstationId=null
+      this.form.workstationId = null
       this.title = '新增检查记录'
       this.optType = 'add'
     },
@@ -749,7 +648,7 @@ export default {
       this.download('iscs/check/exportIsMaterialsCheckRecord', {
         ...this.queryParams
       }, `records_${new Date().getTime()}.xlsx`)
-    },
+    }
   }
 }
 </script>

+ 49 - 8
src/views/mes/material/collectionmanagement/index.vue

@@ -145,23 +145,33 @@
       :data="teamList"
       @selection-change="handleSelectionChange"
     >
-      <el-table-column type="selection" width="55" align="center" />
+<!--      <el-table-column type="selection" width="55" align="center" />-->
+      <el-table-column v-if="!visibleSelect" label="物资柜" align="center" prop="loanFromName">
+      </el-table-column>
       <el-table-column label="物资编号" align="center" prop="materialsId">
       </el-table-column>
       <el-table-column label="物资名称" align="center" prop="materialsName" />
       <el-table-column label="物资类型" align="center" prop="materialsTypeName" />
       <el-table-column
         label="物资图片"
-        align="center"
         prop="materialsTypePicture"
       >
         <template slot-scope="scope">
-          <img
-            v-if="scope.row.materialsTypePicture"
-            :src="scope.row.materialsTypePicture"
-            alt=""
-            style="width: 50px; height: 50px"
-          />
+          <div class="img-box" v-if="scope.row.materialsTypePicture">
+            <el-image
+              style="width: 50px; height: 50px"
+              :preview-teleported="true"
+              class="images"
+              :hide-on-click-modal=true
+              :src="scope.row.materialsTypePicture"
+              :zoom-rate="1.2"
+              :preview-src-list="[scope.row.materialsTypePicture]"
+              :initial-index="1"
+              fit="cover"
+            >
+            </el-image>
+            <i class="el-icon-zoom-in" id="eyeicon"></i>
+          </div>
           <span v-else>-</span>
         </template>
       </el-table-column>
@@ -508,3 +518,34 @@ export default {
   width: 380px !important;
 }
 </style>
+  <style lang="scss" >
+  //图片放大
+  .img-box {
+    width: 50px;
+    height: 50px;
+    position: relative;
+
+    #eyeicon {
+      display: none;
+    }
+  }
+
+  .img-box:hover {
+    background: #000;
+
+    .images {
+      opacity: 0.6;
+    }
+
+    #eyeicon {
+      display: block;
+      position: absolute;
+      top: 40%;
+      left: 40%;
+      z-index: 100;
+      color: white;
+      pointer-events: none
+    }
+  }
+
+  </style>

+ 156 - 108
src/views/mes/material/inspectionplan/index.vue

@@ -32,7 +32,7 @@
         </el-select>
       </el-form-item>
 
-       <el-form-item label="计划日期">
+      <el-form-item label="计划日期">
         <el-date-picker
           style="width: 300px"
           :default-time="['00:00:00', '23:59:59']"
@@ -43,6 +43,7 @@
           start-placeholder="开始日期"
           end-placeholder="结束日期"
           align="right"
+
         >
         </el-date-picker>
       </el-form-item>
@@ -97,19 +98,19 @@
         >新增
         </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>-->
+      <!--       <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"
@@ -207,18 +208,20 @@
             style="width: 350px"
             v-model="form.planDate"
             placeholder="请选择日期"
-            :picker-options="pickerOptions"
+            :picker-options="FormpickerOptions"
             align="right"
           >
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="所属岗位" prop="workstationId">
-          <treeselect  style="width: 348px" v-model="form.workstationId" :options="workstationOption"
-                      :normalizer="normalizer" placeholder="选择岗位"
+        <el-form-item label="所属区域" prop="workstationId">
+          <treeselect style="width: 348px" v-model="form.workstationId" :options="workstationOption"
+                      :normalizer="normalizer" placeholder="选择所属区域"
           />
         </el-form-item>
         <el-form-item label="检查物资柜" prop="cabinetIds">
+
           <el-select
+            :disabled="visibleSelect"
             style="width: 348px"
             v-model="form.cabinetIds"
             placeholder="请选择需要检查的物资柜"
@@ -283,10 +286,10 @@ import Template from '@/views/print/printtemplate/list.vue'
 export default {
   name: 'Team',
   components: { Template, Treeselect, Crontab },
-  props:{
-    cabinetId:{
-      type:String,
-      required:false
+  props: {
+    cabinetId: {
+      type: String,
+      required: false
     }
   },
   dicts: ['material_status', 'checking_status'],
@@ -319,15 +322,17 @@ export default {
       queryParams: {
         current: 1,
         size: 10,
-        checkUserName:'',
-        planName:'',
-        cabinetId:'',
-        startTime:null,
-        endTime:null,
-        status:''
+        checkUserName: '',
+        planName: '',
+        cabinetId: '',
+        startTime: null,
+        endTime: null,
+        status: ''
       },
       // 表单参数
-      form: {},
+      form: {
+        cabinetIds: ''
+      },
       cabinets: [], //物资所属柜
       planPersonOption: [], // 检查人员
       workstationOption: [],//所属岗位
@@ -342,6 +347,7 @@ export default {
 
       },
       pickerOptions: {
+
         shortcuts: [
           {
             text: '最近一周',
@@ -372,20 +378,54 @@ export default {
           }
         ]
       },
-      visibleSelect:false,//控制查询
+      FormpickerOptions: {
+        disabledDate(time) {
+          return time.getTime() < Date.now() - 8.64e7;
+        },
+        shortcuts: [
+          {
+            text: '最近一周',
+            onClick(picker) {
+              const end = new Date()
+              const start = new Date()
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+              picker.$emit('pick', [start, end])
+            }
+          },
+          {
+            text: '最近一个月',
+            onClick(picker) {
+              const end = new Date()
+              const start = new Date()
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
+              picker.$emit('pick', [start, end])
+            }
+          },
+          {
+            text: '最近三个月',
+            onClick(picker) {
+              const end = new Date()
+              const start = new Date()
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
+              picker.$emit('pick', [start, end])
+            }
+          }
+        ]
+      },
+      visibleSelect: false//控制查询
     }
   },
-  watch:{
-    'form.workstationId':function(newVal, oldVal) {
+  watch: {
+    'form.workstationId': function(newVal, oldVal) {
       if (newVal) {
-        console.log(newVal,'gangwei ')
+        console.log(newVal, 'gangwei ')
         const data = {
           current: 1,
           size: -1,
-          workstationId: newVal,
+          workstationId: newVal
         }
         getIsMaterialsCabinets(data).then((response) => {
-          console.log(response,'wgahah')
+          console.log(response, 'wgahah')
           if (response?.data?.records) {
             this.cabinets = response.data.records.map((item) => ({
               value: item.cabinetId,
@@ -397,9 +437,9 @@ export default {
     }
   },
   created() {
-    this.queryParams.cabinetId = this.cabinetId||null
-    if(this.cabinetId){
-      this.visibleSelect=true
+    this.queryParams.cabinetId = this.cabinetId || null
+    if (this.cabinetId) {
+      this.visibleSelect = true
     }
     this.getList()
     this.getOtherList()
@@ -408,14 +448,14 @@ export default {
   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");
+      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}`;
+      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
     },
     /** 查询物资信息列表 */
     getList() {
@@ -442,7 +482,7 @@ export default {
     getOtherList() {
       const data = {
         current: 1,
-        size: -1,
+        size: -1
       }
       getIsMaterialsCabinets(data).then((response) => {
         if (response?.data?.records) {
@@ -454,7 +494,8 @@ export default {
       })
       const data1 = {
         pageSize: 999999999,
-        pageNum: 1
+        pageNum: 1,
+        roleId:12
       }
       listUser(data1).then((res) => {
         this.planPersonOption = res.rows.map((item) => {
@@ -465,7 +506,9 @@ export default {
         })
       })
       listMarsDept(data).then(res => {
-        const data=res.data.records.filter((item) => {return item.parentId=='0'})
+        const data = res.data.records.filter((item) => {
+          return item.parentId == '0'
+        })
         this.workstationOption = this.handleTree(data, 'workstationId', 'parentId')
       })
     },
@@ -481,88 +524,56 @@ export default {
     },
     /* 物资柜信息转换展示 */
     getDisplayText(cabinetName) {
-      const names = cabinetName.split(',');
-      if(names.length ==1) {
-        return `${names.length}个 (${names[0]})`;
+      const names = cabinetName.split(',')
+      if (names.length == 1) {
+        return `${names.length}个 (${names[0]})`
       }
       if (names.length > 1) {
-        return `${names.length}个 (${names[0]}...)`;
+        return `${names.length}个 (${names[0]}...)`
       }
-      return names[0];
+      return names[0]
     },
-    goto(row){
-      console.log(row,'goto检查计划查看')
-      if(this.cabinetId){
+    goto(row) {
+      console.log(row, 'goto检查计划查看')
+      if (this.cabinetId) {
         this.$emit('planId', {
           planId: row.planId,
           planName: row.planName
-        });
-      }else{
+        })
+      } else {
         this.$router.push({
-          path:'/material/Inspectionrecords',
-          query:{
-            planId:row.planId,
-            planName:row.planName,
+          path: '/material/Inspectionrecords',
+          query: {
+            planId: row.planId,
+            planName: row.planName
           }
         })
       }
-
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false
-      this.reset()
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        planName:'',
-        cabinetIds:'',
-        workstationId:'',
-        checkUserName:'',
-      }
-      this.resetForm('form')
-      this.autoGenFlag = false
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.current = 1
-      this.getList()
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm('queryForm')
-      this.queryParams.startTime = ''
-      this.queryParams.endTime = ''
-      this.createTime=''
-      this.handleQuery()
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.planId)
-      this.single = selection.length !== 1
-      this.multiple = !selection.length
     },
-
     /** 新增按钮操作 */
     handleAdd() {
       this.reset()
       this.open = true
-      this.form.workstationId=null
+      this.form.workstationId = null
       this.title = '新增检查计划'
       this.optType = 'add'
+      if (this.visibleSelect) {
+        this.form.cabinetIds = [this.cabinetId]
+      }
+      this.form.planName=`物资检查计划${this.formatELTime(new Date())}`
     },
+
     formatELTime(date) {
-      if (!date) return '';
-      const d = new Date(date);
+      if (!date) return ''
+      const d = new Date(date)
       let month = '' + (d.getMonth() + 1),
         day = '' + d.getDate(),
-        year = d.getFullYear();
+        year = d.getFullYear()
 
-      if (month.length < 2) month = '0' + month;
-      if (day.length < 2) day = '0' + day;
+      if (month.length < 2) month = '0' + month
+      if (day.length < 2) day = '0' + day
 
-      return [year, month,day ].join('-');
+      return [year, month, day].join('-')
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -580,7 +591,7 @@ export default {
       this.$refs['form'].validate((valid) => {
         if (valid) {
           if (this.form.planId != null) {
-            this.form.planDate=this.formatELTime(this.form.planDate)
+            this.form.planDate = this.formatELTime(this.form.planDate)
             updatePlan(this.form).then((response) => {
               console.log(response, '修改返回')
               this.$modal.msgSuccess('修改成功')
@@ -588,7 +599,7 @@ export default {
               this.getList()
             })
           } else {
-            this.form.planDate=this.formatELTime(this.form.planDate)
+            this.form.planDate = this.formatELTime(this.form.planDate)
             addPlan(this.form).then((response) => {
               console.log(response, '新增返回')
               this.$modal.msgSuccess('新增成功')
@@ -599,6 +610,43 @@ export default {
         }
       })
     },
+    // 取消按钮
+    cancel() {
+      this.open = false
+      this.reset()
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        planName: '',
+        cabinetIds: '',
+        workstationId: '',
+        checkUserName: ''
+      }
+      this.resetForm('form')
+      this.autoGenFlag = false
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.current = 1
+      this.getList()
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm('queryForm')
+      this.queryParams.startTime = ''
+      this.queryParams.endTime = ''
+      this.createTime = ''
+      this.handleQuery()
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map((item) => item.planId)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+
+
     /** 删除按钮操作 */
     handleDelete(row) {
       const checkIds = row.planId || this.ids

+ 42 - 18
src/views/mes/material/instructions/index.vue

@@ -98,6 +98,7 @@
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="说明编号" align="center" prop="instructionsId">
       </el-table-column>
+      <el-table-column prop="orderNum" label="排序" ></el-table-column>
       <el-table-column label="标题" align="center" prop="instructionsTitle"/>
       <el-table-column
         label="物资类型"
@@ -119,7 +120,6 @@
         </template>
       </el-table-column>
       <el-table-column label="添加时间" prop="createTime" align="center" >
-
       </el-table-column>
       <el-table-column
         label="操作"
@@ -188,15 +188,36 @@
             />
           </el-select>
         </el-form-item>
-        <el-form-item label="文件">
-          <el-button v-no-more-click
-                     type="info"
-                     plain
-                     icon="el-icon-upload2"
-                     size="mini"
-                     @click="handleFileUpload"
-                     v-hasPermi="['iscs:sop:import']"
-          >导入</el-button>
+        <el-form-item label="显示排序" prop="orderNum">
+          <el-input-number
+            style="width: 350px"
+            v-model="form.orderNum"
+            controls-position="right"
+            :min="0"
+          />
+        </el-form-item>
+        <el-form-item label="文件" prop="fileUrl">
+          <div v-if="form.fileUrl">
+            <div v-if="isVideo(form.fileUrl)">
+              <video :src="form.fileUrl" width="300" height="200" controls></video>
+            </div>
+            <div v-if="isPdf(form.fileUrl)">
+              <embed :src="form.fileUrl" width="300" height="200" type="application/pdf">
+            </div>
+            <el-button v-no-more-click
+                       type="danger"
+                       size="mini"
+                       @click="deleteFile">删除</el-button>
+          </div>
+          <div v-else>
+            <el-button v-no-more-click
+                       type="info"
+                       plain
+                       icon="el-icon-upload2"
+                       size="mini"
+                       @click="handleFileUpload"
+                       v-hasPermi="['iscs:sop:import']">导入</el-button>
+          </div>
         </el-form-item>
       </el-form>
 
@@ -231,12 +252,7 @@
         <i class="el-icon-upload"></i>
         <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
         <div class="el-upload__tip text-center" slot="tip">
-<!--          <div class="el-upload__tip" slot="tip">-->
-<!--            <el-checkbox v-model="upload.updateSupport" />-->
-<!--            是否更新已经存在的用户数据-->
-<!--          </div>-->
           <span>mp4、pdf格式文件。</span>
-
         </div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -307,6 +323,7 @@ export default {
       },
       // 表单参数
       form: {
+        fileUrl:''
       },
       // 表单校验
       rules: {
@@ -343,11 +360,19 @@ export default {
   },
 
   methods: {
-
+    isVideo(url) {
+      return url && (url.endsWith('.mp4') || url.includes('mp4'));
+    },
+    isPdf(url) {
+      return url && (url.endsWith('.pdf') || url.includes('pdf'));
+    },
     handleFileUpload(){
-      this.upload.title = "供应商导入";
+      this.upload.title = "导入";
       this.upload.open = true;
     },
+    deleteFile() {
+      this.form.fileUrl = ''; // 删除文件
+    },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
@@ -469,7 +494,6 @@ export default {
               this.getList()
             })
           } else {
-
             console.log(this.form, '新增参数')
             addInstructions(this.form).then((response) => {
               console.log(response, '新增返回')

+ 33 - 21
src/views/mes/material/lockers/DetailsIndex.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-radio-group v-model="tabPosition" style="margin: 5px">
+    <el-radio-group v-model="tabPosition" style="margin: 5px" @change="handleTabChange">
       <el-radio-button label="first">物资清单</el-radio-button>
       <el-radio-button label="second">领取记录</el-radio-button>
       <el-radio-button label="third">检查计划</el-radio-button>
@@ -13,7 +13,7 @@
     </div>
     <!-- 领取记录 -->
     <div v-if="tabPosition == 'second'" class="materialsListcon">
-      <CollectionManagement :cabinetId="cabinetId" />
+      <CollectionManagement :cabinetId="cabinetId"/>
     </div>
     <!-- 检查计划 -->
     <div v-if="tabPosition == 'third'" class="materialsListcon">
@@ -31,11 +31,11 @@
 </template>
 
 <script>
-import MaterialInfromation from "@/views/mes/material/materialinformation/index.vue";
-import CollectionManagement from "@/views/mes/material/collectionmanagement/index.vue";
-import InspectionPlan from "@/views/mes/material/inspectionplan/index.vue";
-import InspectionRecords from "@/views/mes/material/Inspectionrecords/index.vue";
-import ReplacementRecords from "@/views/mes/material/replacementrecords/index.vue";
+import MaterialInfromation from '@/views/mes/material/materialinformation/index.vue'
+import CollectionManagement from '@/views/mes/material/collectionmanagement/index.vue'
+import InspectionPlan from '@/views/mes/material/inspectionplan/index.vue'
+import InspectionRecords from '@/views/mes/material/Inspectionrecords/index.vue'
+import ReplacementRecords from '@/views/mes/material/replacementrecords/index.vue'
 
 export default {
   components: {
@@ -43,35 +43,47 @@ export default {
     CollectionManagement,
     InspectionPlan,
     InspectionRecords,
-    ReplacementRecords,
+    ReplacementRecords
   },
   data() {
     return {
-      tabPosition: "first", //顶部切换
+      tabPosition: 'first', //顶部切换
       cabinetId: null,
       planId: null,
-      planName:'',
+      planName: '',
       recordId: null,
-    };
+      PlanData:null,//接收传递的planId和planName
+    }
   },
+
   created() {
-    this.cabinetId=this.$route.query.cabinetId||'';
+    this.cabinetId = this.$route.query.cabinetId || ''
 
   },
   methods: {
+    handleTabChange(newTab) {
+      // 切换tab的操作
+      this.tabPosition = newTab
+      this.PlanData=null
+      this.planId = null
+      this.planName = ''
+    },
     handlePlanId(data) {
-      console.log('接收到的 planId:', data);
-      this.planId = data.planId;
-      this.planName = data.planName;
-      this.tabPosition = 'fourth';
+      console.log('接收到的 planId:', data)
+       this.PlanData = data
+      if (this.PlanData) {
+        this.planId = this.PlanData.planId
+        this.planName = this.PlanData.planName
+      }
+      this.tabPosition = 'fourth'
     },
     handleRecordId(recordId) {
-      console.log('接收到的 recordId:', recordId);
-      this.recordId = recordId;
-      this.tabPosition = 'fifth';
+      console.log('接收到的 recordId:', recordId)
+      this.recordId = recordId
+      this.tabPosition = 'fifth'
     }
-  },
-};
+  }
+}
 </script>
 <style lang="scss" scoped>
 </style>

+ 45 - 10
src/views/mes/material/lockers/index.vue

@@ -135,26 +135,32 @@
           :data="CabinetList"
           @selection-change="handleSelectionChange"
         >
-          <el-table-column type="selection" width="55" align="center"/>
+<!--          <el-table-column type="selection" width="55" align="center"/>-->
           <el-table-column label="物资柜编号" align="center" prop="cabinetId">
           </el-table-column>
           <el-table-column
             label="物资柜名称"
-            align="center"
             prop="cabinetName"
           />
           <el-table-column
-            label="物资图片"
-            align="center"
+            label="物资柜图片"
             prop="cabinetPicture"
           >
             <template slot-scope="scope">
-              <img
-                v-if="scope.row.cabinetPicture"
-                :src="scope.row.cabinetPicture"
-                alt=""
-                style="width: 50px; height: 50px"
-              />
+              <div  class="img-box" v-if="scope.row.cabinetPicture">
+                <el-image
+                  style="width: 75px; height: 75px"
+                  :preview-teleported="true"
+                  class="images"
+                  :hide-on-click-modal=true
+                  :src="scope.row.cabinetPicture"
+                  :zoom-rate="1.2"
+                  :preview-src-list="[scope.row.cabinetPicture]"
+                  :initial-index="1"
+                  fit="cover" >
+                </el-image>
+                <i class="el-icon-zoom-in" id="eyeicon"></i>
+              </div>
               <span v-else>-</span>
             </template>
           </el-table-column>
@@ -600,6 +606,7 @@ export default {
         remark:'',
         cabinetPicture: '',
       }
+
       this.resetForm('form')
       this.autoGenFlag = false
     },
@@ -614,6 +621,7 @@ export default {
       this.queryParams.cabinetCode = null
       this.queryParams.cabinetName = null
       this.resetForm('queryForm')
+
       this.handleQuery()
     },
     // 多选框选中数据
@@ -732,7 +740,34 @@ export default {
   color: #fff;
   cursor: pointer;
 }
+//图片放大
+.img-box {
+  width: 75px;
+  height: 75px;
+  position: relative;
+
+  #eyeicon {
+    display: none;
+  }
+}
+
+.img-box:hover {
+  background: #000;
+
+  .images {
+    opacity: 0.6;
+  }
 
+  #eyeicon {
+    display: block;
+    position: absolute;
+    top: 40%;
+    left: 40%;
+    z-index:100;
+    color: white;
+    pointer-events:none
+  }
+}
 .el-input-width {
   width: 380px !important;
 }

+ 94 - 52
src/views/mes/material/materialinformation/index.vue

@@ -8,7 +8,7 @@
       v-show="showSearch"
       label-width="100px"
     >
-      <el-form-item label="物资柜" prop="materialsCabinetId">
+      <el-form-item :label="visibleSelect?'物资柜':'绑定物资柜'" prop="materialsCabinetId">
         <el-select
           style="width: 215px"
           :disabled="visibleSelect"
@@ -142,19 +142,19 @@
         >绑定物资
         </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:materials:remove']"-->
-<!--        >批量删除-->
-<!--        </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:materials:remove']"-->
+      <!--        >批量删除-->
+      <!--        </el-button>-->
+      <!--      </el-col>-->
       <right-toolbar
         :showSearch.sync="showSearch"
         @queryTable="getList"
@@ -167,6 +167,9 @@
       @selection-change="handleSelectionChange"
     >
       <el-table-column type="selection" width="55" align="center"/>
+
+      <el-table-column :label="visibleSelect?'物资柜':'绑定物资柜'" align="center" prop="cabinetName">
+      </el-table-column>
       <el-table-column label="物资编号" align="center" prop="materialsId">
       </el-table-column>
       <el-table-column label="物资名称" align="center" prop="materialsName"/>
@@ -175,19 +178,27 @@
         align="center"
         prop="materialsTypeName"
       />
+
       <el-table-column
         label="物资图片"
-        align="center"
         prop="materialsTypePicture"
-
       >
         <template slot-scope="scope">
-          <img
-            v-if="scope.row.materialsTypePicture"
-            :src="scope.row.materialsTypePicture"
-            alt=""
-            style="width: 50px; height: 50px"
-          />
+          <div class="img-box" v-if="scope.row.materialsTypePicture">
+            <el-image
+              style="width: 50px; height: 50px"
+              :preview-teleported="true"
+              class="images"
+              :hide-on-click-modal=true
+              :src="scope.row.materialsTypePicture"
+              :zoom-rate="1.2"
+              :preview-src-list="[scope.row.materialsTypePicture]"
+              :initial-index="1"
+              fit="cover"
+            >
+            </el-image>
+            <i class="el-icon-zoom-in" id="eyeicon"></i>
+          </div>
           <span v-else>-</span>
         </template>
       </el-table-column>
@@ -404,10 +415,10 @@
         <i class="el-icon-upload"></i>
         <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
         <div class="el-upload__tip text-center" slot="tip">
-          <div class="el-upload__tip" slot="tip">
-            <el-checkbox v-model="upload.updateSupport"/>
-            是否更新已经存在的用户数据
-          </div>
+<!--          <div class="el-upload__tip" slot="tip">-->
+<!--            <el-checkbox v-model="upload.updateSupport"/>-->
+<!--            是否更新已经存在的用户数据-->
+<!--          </div>-->
           <span>仅允许导入xls、xlsx格式文件。</span>
           <el-link
             type="primary"
@@ -621,13 +632,13 @@ export default {
         // 设置上传的请求头部
         headers: { Authorization: 'Bearer ' + getToken() },
         // 上传的地址
-        // url: process.env.VUE_APP_BASE_API + "/iscs/materials/importMaterials",
-        url: process.env.VUE_APP_BASE_API + '/common/upload'
+        url: process.env.VUE_APP_BASE_API + "/iscs/materials/importMaterials",
+        // url: process.env.VUE_APP_BASE_API + '/common/upload'
       },
 
       // 表单参数
       form: {
-        materialsCabinetId:null
+        materialsCabinetId: null
       },
       cabinets: [], //物资所属柜
       // 表单校验
@@ -640,22 +651,22 @@ export default {
         ]
       },
       machinerytypeOptions: [],
-      materialsIds:[],//绑定物资传递的数据
-      queryParamsBind:{
+      materialsIds: [],//绑定物资传递的数据
+      queryParamsBind: {
         current: 1,
         size: 10,
-        materialsCabinetId: 0,
+        materialsCabinetId: 0
       },
-      dialogMatList:[],//绑定物资弹窗el-table数据
+      dialogMatList: [],//绑定物资弹窗el-table数据
       openBind: false,
-      totalBind:0,//弹窗列表总数
-      visibleSelect:false,
+      totalBind: 0,//弹窗列表总数
+      visibleSelect: false
     }
   },
   created() {
-    this.queryParams.materialsCabinetId = this.cabinetId||null
-    if(this.cabinetId){
-      this.visibleSelect=true
+    this.queryParams.materialsCabinetId = this.cabinetId || null
+    if (this.cabinetId) {
+      this.visibleSelect = true
 
     }
     this.getList()
@@ -667,30 +678,30 @@ export default {
   },
   methods: {
     /* 绑定物资 */
-    handleBind(){
-     this.openBind = true
-      this.getmatInfoList();//绑定物资列表数据
+    handleBind() {
+      this.openBind = true
+      this.getmatInfoList()//绑定物资列表数据
     },
-    getmatInfoList(){
+    getmatInfoList() {
       listMaterials(this.queryParamsBind).then((response) => {
         this.dialogMatList = response.data.records
         this.totalBind = response.data.total
       })
     },
-    submitBind(){
-      const data={
-        materialsCabinetId:this.cabinetId,
-        materialsIds:this.materialsIds
+    submitBind() {
+      const data = {
+        materialsCabinetId: this.cabinetId,
+        materialsIds: this.materialsIds
       }
       updateMaterialsBinding(data).then(res => {
-      console.log(res,'绑定物资')
-        if(res.data){
+        console.log(res, '绑定物资')
+        if (res.data) {
           this.$message.success('绑定成功')
           this.openBind = false
         }
       })
     },
-    handleSelectionBindChange(selection){
+    handleSelectionBindChange(selection) {
       this.materialsIds = selection.map((item) => item.materialsId)
     },
     // 物资绑定结束------
@@ -821,6 +832,7 @@ export default {
             value: item.cabinetId,
             label: item.cabinetName
           }))
+          this.cabinets.push({ value: 0, label: '空' });
         }
       })
     },
@@ -832,8 +844,8 @@ export default {
       this.title = '新增物资信息'
       this.optType = 'add'
       this.form.materialsTypeId = undefined
-      if(this.visibleSelect){
-        this.form.materialsCabinetId=this.cabinetId
+      if (this.visibleSelect) {
+        this.form.materialsCabinetId = this.cabinetId
       }
     },
 
@@ -957,7 +969,37 @@ export default {
   }
 }
 </script>
-<style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
+<style lang="scss" src="@/assets/styles/dialog-title.scss" scoped></style>
+<style lang="scss" >
+//图片放大
+.img-box {
+  width: 50px;
+  height: 50px;
+  position: relative;
+
+  #eyeicon {
+    display: none;
+  }
+}
+
+.img-box:hover {
+  background: #000;
+
+  .images {
+    opacity: 0.6;
+  }
+
+  #eyeicon {
+    display: block;
+    position: absolute;
+    top: 40%;
+    left: 40%;
+    z-index: 100;
+    color: white;
+    pointer-events: none
+  }
+}
+
 .el-input-width {
   width: 380px !important;
 }

+ 12 - 4
src/views/mes/material/replacementrecords/index.vue

@@ -139,7 +139,7 @@
       :data="changeRecordList"
       @selection-change="handleSelectionChange"
     >
-      <el-table-column type="selection" width="55" align="center"/>
+<!--      <el-table-column type="selection" width="55" align="center"/>-->
       <el-table-column label="物资柜" align="center" prop="cabinetName">
       </el-table-column>
 <!--      <el-table-column label="物资名称" align="center" prop="materialsName" />-->
@@ -457,7 +457,7 @@ export default {
   },
 
   created() {
-    this.queryParams.cabinetId = this.cabinetId||''
+
 
     if(this.cabinetId){
       this.visibleSelect=true
@@ -486,14 +486,22 @@ export default {
         this.queryParams.startTime = this.formatDate(this.createTime[0])
         this.queryParams.endTime = this.formatDate(this.createTime[1])
       }
+      if(this.cabinetId){
+        this.queryParams.cabinetId = this.cabinetId||''
+      }
+      if(this.$route.query.recordId||this.recordId){
+        this.queryParams.recordId=this.$route.query.recordId||this.recordId||''
+      }
       const data={
         ...this.queryParams,
-        cabinetId:this.cabinetId,
-        recordId:this.$route.query.recordId||this.recordId,
       }
       listChangeRecord(data).then((response) => {
         console.log(response, '获取物资信息allList ')
         this.changeRecordList = response.data.records
+        if(response.data.records.length > 0){
+          this.queryParams.cabinetId = response.data.records[0].cabinetId
+        }
+
         this.total = response.data.total
         this.loading = false
       })

+ 58 - 17
src/views/mes/material/typeofmaterial/index.vue

@@ -105,36 +105,49 @@
       </el-table-column>
       <el-table-column
         label="物资类型图标"
-        align="center"
         prop="materialsTypeIcon"
-
       >
         <template slot-scope="scope">
-          <img
-            v-if="scope.row.materialsTypeIcon"
-            :src="scope.row.materialsTypeIcon"
-            alt=""
-            style="width: 50px; height: 50px"
-          />
+          <div  class="img-box" v-if="scope.row.materialsTypeIcon">
+            <el-image
+              style="width: 50px; height: 50px"
+              :preview-teleported="true"
+              class="images"
+              :hide-on-click-modal=true
+              :src="scope.row.materialsTypeIcon"
+              :zoom-rate="1.2"
+              :preview-src-list="[scope.row.materialsTypeIcon]"
+              :initial-index="1"
+              fit="cover" >
+            </el-image>
+            <i class="el-icon-zoom-in" id="eyeicon"></i>
+          </div>
           <span v-else>-</span>
         </template>
       </el-table-column>
       <el-table-column
         label="物资类型缩略图"
-        align="center"
         prop="materialsTypePicture"
-
       >
         <template slot-scope="scope">
-          <img
-            v-if="scope.row.materialsTypePicture"
-            :src="scope.row.materialsTypePicture"
-            alt=""
-            style="width: 50px; height: 50px"
-          />
+          <div  class="img-box" v-if="scope.row.materialsTypePicture">
+            <el-image
+              style="width: 50px; height: 50px"
+              :preview-teleported="true"
+              class="images"
+              :hide-on-click-modal=true
+              :src="scope.row.materialsTypePicture"
+              :zoom-rate="1.2"
+              :preview-src-list="[scope.row.materialsTypePicture]"
+              :initial-index="1"
+              fit="cover" >
+            </el-image>
+            <i class="el-icon-zoom-in" id="eyeicon"></i>
+          </div>
           <span v-else>-</span>
         </template>
       </el-table-column>
+
       <el-table-column
         label="是否需要归还"
         align="center"
@@ -684,7 +697,35 @@ this.$forceUpdate();
 };
 </script>
 
-<style scoped>
+<style scoped lang="scss">
+//图片放大
+.img-box {
+  width: 50px;
+  height: 50px;
+  position: relative;
+
+  #eyeicon {
+    display: none;
+  }
+}
+
+.img-box:hover {
+  background: #000;
+
+  .images {
+    opacity: 0.6;
+  }
+
+  #eyeicon {
+    display: block;
+    position: absolute;
+    top: 40%;
+    left: 30%;
+    z-index: 100;
+    color: white;
+    pointer-events: none
+  }
+}
 .time-picker {
   display: flex;
   gap: 15px;