فهرست منبع

批量删除信息提示问题

pm 9 ماه پیش
والد
کامیت
c3bacd144a

+ 4 - 4
src/api/mes/email/templates.js

@@ -11,9 +11,9 @@ export function listEmailTemplates(query) {
 
 
 // 查询邮件模板详细
-export function getEmailTemplatesInfo(templateCode) {
+export function getEmailTemplatesInfo(templateId) {
   return request({
-    url: '/iscs/template/selectIsMailTemplateById?templateCode=' + templateCode,
+    url: '/iscs/template/selectIsMailTemplateById?templateId=' + templateId,
     method: 'get'
   })
 }
@@ -38,9 +38,9 @@ export function updateEmailTemplates(data) {
 }
 
 // 删除邮件模板
-export function delEmailTemplates(templateCodes) {
+export function delEmailTemplates(templateIds) {
   return request({
-    url: '/iscs/template/deleteIsMailTemplateByTemplateCodes?templateCodes=' + templateCodes,
+    url: '/iscs/template/deleteIsMailTemplateByTemplateCodes?templateIds=' + templateIds,
     method: 'post'
   })
 }

+ 0 - 49
src/api/mes/material/checkPlan.js

@@ -1,49 +0,0 @@
-import request from '@/utils/request'
-
-// 查询物资检查计划列表-分页   /dev-api/iscs/plan/getIsMaterialsCheckPlanPage
-export function getPlanList(query) {
-    return request({
-        url: '/iscs/plan/getIsMaterialsCheckPlanPage',
-        method: 'get',
-        params: query
-    })
-
-}
-
-
-// 新增物资检查计划   /dev-api/iscs/plan/insertIsMaterialsCheckPlan
-export function addPlan(data) {
-    return request({
-        url: '/iscs/plan/insertIsMaterialsCheckPlan',
-        method: 'post',
-        data: data
-    })
-}
-
-
-// 删除物资检查计划  /dev-api/iscs/plan/deleteIsMaterialsCheckPlanByPlanIds
-export function deletePlan() {
-    return request({
-        url: '/iscs/plan/deleteIsMaterialsCheckPlanByPlanIds?=planIds' + planIds,
-        method: 'post'
-    })
-}
-
-
-// 修改物资检查计划  ​/dev-api​/iscs​/plan​/updateIsMaterialsCheckPlan
-export function updatePlan(data) {
-    return request({
-        url: '​/iscs​/plan​/updateIsMaterialsCheckPlan',
-        method: 'post',
-        data: data
-    })
-}
-
-// 获取物资检查计划详细信息   /dev-api/iscs/plan/updateIsMaterialsCheckPlan
-export function getPlanDetail(query) {
-    return request({
-        url: '/iscs/plan/updateIsMaterialsCheckPlan',
-        method: 'get',
-        params: query
-    })
-}

+ 46 - 0
src/api/mes/material/checkRecord.js

@@ -0,0 +1,46 @@
+import request from '@/utils/request'
+
+// 查询物资检查记录--分页
+export function listCheckRecord(query) {
+  return request({
+    url: '/iscs/check/getIsMaterialsCheckRecordPage',
+    method: 'get',
+    params: query
+  })
+}
+
+// 新增物资检查记录
+export function addCheckRecord(data) {
+  return request({
+    url: '/iscs/check/insertIsMaterialsCheckRecord',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改物资检查记录
+export function updateCheckRecord(data) {
+  return request({
+    url: '/iscs/check/updateIsMaterialsCheckRecord',
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除物资检查记录
+export function deleteCheckRecord(data) {
+  return request({
+    url: '/iscs/check/deleteIsMaterialsCheckRecordByRecordIds?recordIds=' + data,
+    method: 'post',
+  })
+}
+
+// 获取检查记录详细信息
+export function selectCheckRecordById(query) {
+  return request({
+    url: '/iscs/check/selectIsMaterialsCheckRecordById?recordId=' + query,
+    method: 'get',
+  })
+}
+
+

+ 13 - 28
src/api/mes/material/plan.js

@@ -1,61 +1,46 @@
 import request from '@/utils/request'
 
 // 查询物资检查计划--分页
-export function listCheckTask(query) {
+export function listPlan(query) {
   return request({
-    url: '/iscs/task/getIsCheckTaskPage',
+    url: '/iscs/plan/getIsMaterialsCheckPlanPage',
     method: 'get',
     params: query
   })
 }
 
-// 新增物资检查计划 业务交叉API
-export function addCheckTask(data) {
+// 新增物资检查计划
+export function addPlan(data) {
   return request({
-    url: '/iscs/resapi/insertIsCheckTask',
+    url: '/iscs/plan/insertIsMaterialsCheckPlan',
     method: 'post',
     data: data
   })
 }
 
-// 修改物资检查计划 业务交叉API
-export function updateCheckTask(data) {
+// 修改物资检查计划
+export function updatePlan(data) {
   return request({
-    url: '/iscs/resapi/updateIsCheckTask',
+    url: '/iscs/plan/updateIsMaterialsCheckPlan',
     method: 'post',
     data: data
   })
 }
 
-// 删除物资检查计划  业务交叉API
-export function deleteCheckTask(data) {
+// 删除物资检查计划
+export function deletePlan(data) {
   return request({
-    url: '/iscs/resapi/deleteIsCheckTaskByCheckIds?checkIds=' + data,
+    url: '/iscs/plan/deleteIsMaterialsCheckPlanByPlanIds?planIds=' + data,
     method: 'post',
   })
 }
 
 // 获取检查计划详细信息
-export function selectCheckTaskById(query) {
+export function selectPlanById(query) {
   return request({
-    url: '/iscs/task/selectIsCheckTaskById?checkId=' + query,
+    url: '/iscs/plan/selectIsMaterialsCheckPlanById?planId=' + query,
     method: 'get',
   })
 }
 
 
-// 物资所属柜 查询物资柜-分页
-export function getIsCheckTaskCabinets() {
-  return request({
-    url: '/iscs/cabinet/getIsMaterialsCabinetPage',
-    method: 'get',
-  })
-}
-// 检查计划 人员选择
-export function getPlanPerson(query) {
-  return request({
-    url: '/system/user/list',
-    method: 'get',
-    params: query
-  })
-}

+ 46 - 0
src/api/mes/material/replace.js

@@ -0,0 +1,46 @@
+import request from '@/utils/request'
+
+// 查询物资检查记录--分页
+export function listChangeRecord(query) {
+  return request({
+    url: '/iscs/change/getIsMaterialsChangeRecordPage',
+    method: 'get',
+    params: query
+  })
+}
+
+// 新增物资检查记录
+export function addChangeRecord(data) {
+  return request({
+    url: '/iscs/change/insertIsMaterialsChangeRecord',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改物资检查记录
+export function updateChangeRecord(data) {
+  return request({
+    url: '/iscs/check/updateIsMaterialsChangeRecord',
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除物资检查记录
+export function deleteChangeRecord(data) {
+  return request({
+    url: '/iscs/change/deleteIsMaterialsChangeRecordByChangeIds?changeIds=' + data,
+    method: 'post',
+  })
+}
+
+// 获取检查记录详细信息
+export function selectChangeRecordById(query) {
+  return request({
+    url: '/iscs/change/selectIsMaterialsChangeRecordById?changeId=' + query,
+    method: 'get',
+  })
+}
+
+

+ 133 - 27
src/views/mes/email/emailNotify/index.vue

@@ -50,7 +50,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['iscs:template:add']"
+          v-hasPermi="['iscs:notify:add']"
           >新增
         </el-button>
       </el-col>
@@ -63,7 +63,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['iscs:blacklist:remove']"
+          v-hasPermi="['iscs:notify:remove']"
           >批量删除
         </el-button>
       </el-col>
@@ -76,7 +76,7 @@
     <el-table
       v-if="refreshTable"
       v-loading="loading"
-      :data="templatesList"
+      :data="templatesNotifyList"
       @selection-change="handleSelectionChange"
     >
       <el-table-column type="selection" width="55" align="center" />
@@ -95,7 +95,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['iscs:template:edit']"
+            v-hasPermi="['iscs:notify:edit']"
             >编辑
           </el-button>
         </template>
@@ -109,24 +109,39 @@
       @pagination="getList"
     />
     <!-- 添加或修改对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="470px" append-to-body>
+    <el-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">
-        <el-form-item label="邮件模板编号" prop="templateCode">
-          <el-input
-            v-model="form.templateCode"
-            placeholder="请输入邮件模板名称"
-          />
-        </el-form-item>
         <el-form-item label="提醒事项" prop="name">
-          <el-input v-model="form.name" placeholder="请输入邮件模板名称" />
+          <el-input v-model="form.name" placeholder="请输入提醒事项" />
+        </el-form-item>
+        <el-form-item label="邮件模板" prop="templateCode">
+         <el-select v-model="form.templateCode">
+           <el-option v-for="item in templatesList" :key="item.templateCode" :label="item.templateName" :value="item.templateCode" >
+           </el-option>
+         </el-select>
         </el-form-item>
-        <el-form-item label="邮件模板内容" prop="content">
-          <el-input
-            type="textarea"
-            :rows="10"
-            v-model="form.content"
-            placeholder="请输入邮件模板名称"
-          />
+        <el-form-item label="提醒时长" prop="reminderTime">
+          <div class="time-picker">
+            <div
+              class="time-unit"
+              v-for="(unit, index) in timeUnits"
+              :key="index"
+            >
+              <select
+                v-model="timeValues.reminderTime[unit.name]"
+                :id="unit.name"
+              >
+                <option
+                  v-for="option in unit.options"
+                  :key="option"
+                  :value="option"
+                >
+                  {{ option }}
+                </option>
+              </select>
+              <label :for="unit.name">{{ unit.label }}</label>
+            </div>
+          </div>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -151,6 +166,7 @@ import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import { genCode } from "@/api/system/autocode/rule";
 import Template from "@/views/print/printtemplate/list.vue";
+import { listEmailTemplates } from '@/api/mes/email/templates'
 
 export default {
   name: "Dept",
@@ -173,7 +189,8 @@ export default {
       // 非多个禁用
       multiple: true,
       // 邮件模板列表
-      templatesList: [],
+      templatesList: [],//模板列表
+      templatesNotifyList:[],//提醒列表
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -203,10 +220,43 @@ export default {
           { required: true, message: "邮件模板内容不能为空", trigger: "blur" },
         ],
       },
+      timeUnits: [
+        {
+          name: "days",
+          label: "天",
+          options: Array.from({ length: 31 }, (_, i) => i),
+        },
+        {
+          name: "hours",
+          label: "小时",
+          options: Array.from({ length: 24 }, (_, i) => i),
+        },
+        {
+          name: "minutes",
+          label: "分钟",
+          options: Array.from({ length: 60 }, (_, i) => i),
+        },
+        {
+          name: "seconds",
+          label: "秒",
+          options: Array.from({ length: 60 }, (_, i) => i),
+        },
+      ],
+      // 借用时长
+      timeValues: {
+        reminderTime: {
+          days: 0,
+          hours: 0,
+          minutes: 0,
+          seconds: 0,
+        },
+
+      },
     };
   },
   created() {
     this.getList();
+    this.getOtherList()
   },
 
   methods: {
@@ -215,12 +265,22 @@ export default {
       this.loading = true;
       listIsMailNotifyConfigPage(this.queryParams).then((response) => {
         debugger;
-        this.templatesList = response.data.records;
+        this.templatesNotifyList = response.data.records;
         this.total = response.data.total;
         this.loading = false;
         console.log(response.data.records, "列表内容");
       });
     },
+    getOtherList(){
+      const data={
+        current: 1,
+        size: -1,
+      }
+      listEmailTemplates(data).then((response) => {
+        debugger;
+        this.templatesList = response.data.records;
+      })
+    },
 
     // 取消按钮
     cancel() {
@@ -235,6 +295,15 @@ export default {
         sopName: undefined,
       };
       this.autoGenFlag = false;
+      // 重置所有时间值
+      const resetTimeValues = (timeObj) => {
+        timeObj.days = 0;
+        timeObj.hours = 0;
+        timeObj.minutes = 0;
+        timeObj.seconds = 0;
+      };
+
+      resetTimeValues(this.timeValues.reminderTime);
       this.resetForm("form");
     },
 
@@ -267,7 +336,7 @@ export default {
     handleUpdate(row) {
       this.reset();
       this.isEdit = true;
-      getEmailTemplatesInfo(row.templateCode).then((response) => {
+      getIsMailNotifyConfigById(row.templateCode).then((response) => {
         this.form = response.data;
         this.open = true;
         this.title = "修改邮件模板";
@@ -284,11 +353,12 @@ export default {
               this.getList();
             });
           } else {
-            addIsMailNotifyConfig(this.form).then((response) => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
+            console.log(this.form.reminderTime,'提醒时长');
+            // addIsMailNotifyConfig(this.form).then((response) => {
+            //   this.$modal.msgSuccess("新增成功");
+            //   this.open = false;
+            //   this.getList();
+            // });
           }
         }
       });
@@ -310,3 +380,39 @@ export default {
   },
 };
 </script>
+<style lang="scss" scoped>
+.time-picker {
+  display: flex;
+  gap: 15px;
+  align-items: center;
+  padding: 0 10px;
+  border-radius: 8px;
+}
+
+.time-unit {
+  /* width: 100%; */
+  /* background: #000; */
+  display: flex;
+  /* flex-direction: column; */
+}
+
+label {
+  font-size: 14px;
+  color: #333;
+  margin-left: 10px;
+}
+
+select {
+  padding: 8px;
+  margin-left: -10px;
+  font-size: 14px;
+  border: 1px solid #ddd;
+  border-radius: 4px;
+  transition: border-color 0.3s ease;
+}
+
+select:focus {
+  border-color: #007bff;
+  outline: none;
+}
+</style>

+ 25 - 20
src/views/mes/email/emailTemplates/index.vue

@@ -7,17 +7,17 @@
       :inline="true"
       v-show="showSearch"
     >
-      <el-form-item label="名称" prop="name">
+      <el-form-item label="名称" prop="templateName">
         <el-input
-          v-model="queryParams.name"
+          v-model="queryParams.templateName"
           placeholder="请输入名称"
           clearable
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="内容" prop="content">
+      <el-form-item label="内容" prop="templateContent">
         <el-input
-          v-model="queryParams.content"
+          v-model="queryParams.templateContent"
           placeholder="请输入内容"
           clearable
           @keyup.enter.native="handleQuery"
@@ -63,7 +63,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['iscs:blacklist:remove']"
+          v-hasPermi="['iscs:template:remove']"
           >批量删除
         </el-button>
       </el-col>
@@ -84,8 +84,8 @@
         prop="templateCode"
         label="邮件模板编号"
       ></el-table-column>
-      <el-table-column prop="name" label="邮件模板名称"></el-table-column>
-      <el-table-column prop="content" label="内容">
+      <el-table-column prop="templateName" label="邮件模板名称"></el-table-column>
+      <el-table-column prop="templateContent" label="内容">
         <template slot-scope="scope">
           <el-button type="text" @click="check(scope.row)">查看</el-button>
         </template>
@@ -135,23 +135,23 @@
       @pagination="getList"
     />
     <!-- 添加或修改部门对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="470px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+    <el-dialog :title="title" :visible.sync="open" width="450px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
         <el-form-item label="邮件模板编号" prop="templateCode">
           <el-input
             v-model="form.templateCode"
-            placeholder="请输入邮件模板名称"
+            placeholder="请输入邮件模板编号"
           />
         </el-form-item>
-        <el-form-item label="邮件模板名称" prop="name">
-          <el-input v-model="form.name" placeholder="请输入邮件模板名称" />
+        <el-form-item label="邮件模板名称" prop="templateName">
+          <el-input v-model="form.templateName" placeholder="请输入邮件模板名称" />
         </el-form-item>
-        <el-form-item label="邮件模板内容" prop="content">
+        <el-form-item label="邮件模板内容" prop="templateContent">
           <el-input
             type="textarea"
             :rows="10"
-            v-model="form.content"
-            placeholder="请输入邮件模板名称"
+            v-model="form.templateContent"
+            placeholder="请输入邮件模板内容"
           />
         </el-form-item>
       </el-form>
@@ -278,7 +278,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.codes = selection.map((item) => item.templateCode);
+      this.codes = selection.map((item) => item.templateId);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
@@ -293,7 +293,8 @@ export default {
     handleUpdate(row) {
       this.reset();
       this.isEdit = true;
-      getEmailTemplatesInfo(row.templateCode).then((response) => {
+      console.log(row,'row');
+      getEmailTemplatesInfo(row.templateId).then((response) => {
         this.form = response.data;
         this.open = true;
         this.title = "修改邮件模板";
@@ -319,13 +320,17 @@ export default {
         }
       });
     },
+    /* 查看 */
+    check(row){
+        console.log(row);
+    },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const templateCodes = row.templateCode || this.codes;
+      const templateIds = row.templateId || this.codes;
       this.$modal
-        .confirm('是否确认删除名称为"' + templateCodes + '"的数据项?')
+        .confirm('是否确认删除名称为"' + templateIds + '"的数据项?')
         .then(function () {
-          return delEmailTemplates(templateCodes);
+          return delEmailTemplates(templateIds);
         })
         .then(() => {
           this.getList();

+ 2 - 2
src/views/mes/hw/lotoStation/index.vue

@@ -423,7 +423,7 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map((item) => item.lotoId);
-      this.codes = selection.map((item) => item.lotoCode);
+      this.codes = selection.map((item) => item.lotoName);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
@@ -476,7 +476,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const repairIds = row.lotoId || this.ids;
-      const repairCodes = row.lotoCode || this.codes;
+      const repairCodes = row.lotoName || this.codes;
       this.$modal
         .confirm('是否确认删除编码为"' + repairCodes + '"的数据项?')
         .then(function () {

+ 2 - 1
src/views/mes/job/joblist/index.vue

@@ -485,8 +485,9 @@ export default {
     handleDelete(row) {
       const teamIds = row.ticketId || this.ids;
       const ticketNames = row.ticketName || this.codes;
+      // '是否确认删除作业票编号为"' + ticketNames + '"的数据项?'
       this.$modal
-        .confirm('是否确认删除作业票编号为"' + ticketNames + '"的数据项?')
+        .confirm('是否确认删除数据项?')
         .then(function () {
           return deleteIsJobTicket(teamIds);
         })

+ 307 - 60
src/views/mes/material/Inspectionrecords/index.vue

@@ -20,7 +20,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="-"
@@ -118,18 +118,46 @@
         >
       </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>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
+    </el-row>
     <el-table
       v-loading="loading"
-      :data="materialsList"
+      :data="RecordList"
       @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="planId">
       </el-table-column>
-      <el-table-column label="岗位" align="center" prop="workstationId">
-      </el-table-column>
-      <el-table-column label="物资柜" align="center" prop="cabinetIdStr">
+      <el-table-column label="物资柜" align="center" prop="cabinetId">
       </el-table-column>
       <el-table-column label="物资编号" align="center" prop="materialsId">
       </el-table-column>
@@ -150,16 +178,17 @@
           <span v-else>-</span>
         </template>
       </el-table-column>
-      <el-table-column label="RFID" align="center" prop="RFID">
+      <el-table-column label="RFID" align="center" prop="materialsRfid">
       </el-table-column>
 
       <el-table-column
         label="检查时间"
         align="center"
-        prop="cron"
+        prop="createTime"
+        width="250"
       >
         <template slot-scope="scope">
-          {{ cronDescription(scope.row.cron) }}
+          {{ scope.row.createTime }}
         </template>
       </el-table-column>
       <el-table-column label="状态" align="center" prop="status">
@@ -167,14 +196,40 @@
           <dict-tag :options="dict.type.checking_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
-      <el-table-column label="异常原因" align="center" prop="RFID">
+      <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>
         </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"
@@ -183,32 +238,137 @@
       :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 {
-  listCheckTask,
-  addCheckTask,
-  getPlanPerson,
-  updateCheckTask,
-  deleteCheckTask,
-  selectCheckTaskById,
-  getIsCheckTaskCabinets
-} from '@/api/mes/material/plan'
-import { genCode } from '@/api/system/autocode/rule'
-import Crontab from '@/components/Crontab/index.vue'
-import cronstrue from 'cronstrue/i18n';
+  listCheckRecord,addCheckRecord,updateCheckRecord,deleteCheckRecord,selectCheckRecordById
+} from '@/api/mes/material/checkRecord'
 import Treeselect from '@riophae/vue-treeselect'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 import { listMarsDept } from '@/api/system/marsdept'
+import { getIsMaterialsCabinets } from '@/api/mes/material/information'
 import { listType } from '@/api/mes/material/typeindex'
 import Template from '@/views/print/printtemplate/list.vue'
+import { listUser } from '@/api/system/user'
+import { listPlan } from '@/api/mes/material/plan'
 
 export default {
   name: 'Team',
-  components: { Template, Treeselect, Crontab },
+  components: { Template, Treeselect },
   dicts: ['material_status','checking_status'],
   data() {
     return {
@@ -226,13 +386,16 @@ export default {
       multiple: true,
       // 显示搜索条件
       showSearch: true,
+      // 弹出层标题
+      title: '',
       // 总条数
       total: 0,
-      // 班组表格数据
-      materialsList: [],
+      // 检查记录表格数据
+      RecordList: [],
       // mars树选项
       marsOptions: [],
-
+// 是否显示弹出层
+      open: false,
       // 查询参数
       createTime: '',
       queryParams: {
@@ -246,16 +409,12 @@ export default {
         startTime: '',
         endTime: ''
       },
-      // 查询参数
-      queryParamsCabinets: {
-        current: 1,
-        size: -1
-      },
-
       // 表单参数
       form: {},
       cabinets: [], //物资所属柜
-      planPersonOption: [],// 检查人员
+      planPersonOption: [], // 检查人员
+      planList:[],//检查计划Id
+      workstationOption: [],//所属岗位
       // 表单校验
       rules: {
         userIdStr: [
@@ -310,7 +469,19 @@ export default {
   },
 
   methods: {
+    goto(){
 
+    },
+    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
@@ -319,16 +490,9 @@ export default {
         this.queryParams.startTime = this.formatDate(this.createTime[0])
         this.queryParams.endTime = this.formatDate(this.createTime[1])
       }
-      listCheckTask(this.queryParams).then((response) => {
-        console.log(response, '获取物资信息allList ')
-        this.materialsList = response.data.records
+      listCheckRecord(this.queryParams).then((response) => {
+        this.RecordList = response.data.records
         this.total = response.data.total
-        this.machinerytypeList = this.handleTree(
-          response.data.records,
-          'materialsTypeId',
-          'parentId',
-          'children'
-        )
         this.loading = false
       })
 
@@ -351,7 +515,11 @@ export default {
     },
     /** 查询物资柜结构 */
     materialsCabinets() {
-      getIsCheckTaskCabinets(this.queryParamsCabinets).then((response) => {
+      const data2 = {
+        current: 1,
+        size: -1,
+      }
+      getIsMaterialsCabinets(data2).then((response) => {
         if (response?.data?.records) {
           // 提取 cabinetId 和 cabinetName
           this.cabinets = response.data.records.map((item) => ({
@@ -359,22 +527,20 @@ export default {
             label: item.cabinetName
           }))
         }
-        // 岗位查询
-        const data1 = {
-          pasge: 1,
-          size: -1
-        }
-        listMarsDept(data1).then((response) => {
-          this.marsOptions = this.handleTree(response.data.records,"workstationId","parentId")
-        })
       })
-      // 巡检人员
-      const data = {
-        pageNum: 1,
-        pageSize: 99999
+      // 岗位查询
+      const data3 = {
+        pasge: 1,
+        size: -1
+      }
+      listMarsDept(data3).then((response) => {
+        this.marsOptions = this.handleTree(response.data.records,"workstationId","parentId")
+      })
+      const data1 = {
+        pageSize: 999999999,
+        pageNum: 1
       }
-      getPlanPerson(data).then((res) => {
-        console.log(res, '巡检人员信息')
+      listUser(data1).then((res) => {
         this.planPersonOption = res.rows.map((item) => {
           return {
             label: item.nickName,
@@ -382,6 +548,14 @@ export default {
           }
         })
       })
+      listPlan(data2).then((response) => {
+        this.planList = response.data.records.map((item) => {
+          return {
+            label: item.planName,
+            value: item.planId,
+          }
+        })
+      })
     },
     /** 查询岗位下拉树结构 */
     normalizer(node) {
@@ -406,32 +580,105 @@ export default {
       }
     },
 
+// 取消按钮
+    cancel() {
+      this.open = false
+      this.reset()
+    },
     // 表单重置
     reset() {
       this.form = {
-        cron: undefined
+        changeDate:'',
+        changeUserId:'',
+        checkUserName:'',
+        materialsId:'',
+        newMaterialsId:'',
+        newMaterialsRfid:'',
+        oldMaterialsId:'',
+        oldMaterialsRfid:'',
+        planId:''
       }
       this.resetForm('form')
       this.autoGenFlag = false
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pages = 1
+      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.checkId)
+      this.ids = selection.map((item) => item.recordId)
       this.single = selection.length !== 1
       this.multiple = !selection.length
     },
 
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset()
+      this.open = true
+      this.form.workstationId=null
+      this.title = '新增检查记录'
+      this.optType = 'add'
+    },
+
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset()
+      selectCheckRecordById(row.recordId).then((response) => {
+        this.form = response.data
+        this.open = true
+        this.title = '编辑检查记录'
+        this.optType = 'edit'
+      })
+    },
 
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs['form'].validate((valid) => {
+        if (valid) {
+          if (this.form.recordId != null) {
+            updateCheckRecord(this.form).then((response) => {
+              console.log(response, '修改返回')
+              this.$modal.msgSuccess('修改成功')
+              this.open = false
+              this.getList()
+            })
+          } else {
+            addCheckRecord(this.form).then((response) => {
+              console.log(response, '新增返回')
+              this.$modal.msgSuccess('新增成功')
+              this.open = false
+              this.getList()
+            })
+          }
+        }
+      })
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const checkIds = row.recordId || this.ids
+
+      this.$modal
+        .confirm('是否确认删除编号为"' + checkIds + '"的数据项?')
+        .then(function() {
+          return deleteCheckRecord(checkIds)
+        })
+        .then(() => {
+          this.getList()
+          this.$modal.msgSuccess('删除成功')
+        })
+        .catch(() => {
+        })
+    },
 
 
   }

+ 256 - 345
src/views/mes/material/inspectionplan/index.vue

@@ -8,29 +8,34 @@
       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="岗位" prop="workstationId">
-        <treeselect
-          style="width: 218px"
-          v-model="queryParams.workstationId"
-          :options="marsOptions"
-          :normalizer="normalizer"
-          placeholder="选择岗位"
-        />
+      <el-form-item label="物资柜" prop="cabinetId">
+        <el-select
+          v-model="queryParams.cabinetId"
+          placeholder="请选择需要检查的物资柜"
+          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="计划日期">
+       <el-form-item label="计划日期">
         <el-date-picker
           style="width: 300px"
           :default-time="['00:00:00', '23:59:59']"
-          v-model="restitutionTime"
+          v-model="createTime"
           type="datetimerange"
           :picker-options="pickerOptions"
           range-separator="-"
@@ -39,10 +44,10 @@
           align="right"
         >
         </el-date-picker>
-      </el-form-item> -->
-      <el-form-item label="检察员" prop="materialsName">
+      </el-form-item>
+      <el-form-item label="检察员" prop="checkUserName">
         <el-input
-          v-model="queryParams.materialsName"
+          v-model="queryParams.checkUserName"
           placeholder="请输入检察员"
           clearable
           @keyup.enter.native="handleQuery"
@@ -66,14 +71,14 @@
           icon="el-icon-search"
           size="mini"
           @click="handleQuery"
-          >搜索
+        >搜索
         </el-button>
         <el-button
           v-no-more-click
           icon="el-icon-refresh"
           size="mini"
           @click="resetQuery"
-          >重置
+        >重置
         </el-button>
       </el-form-item>
     </el-form>
@@ -88,10 +93,10 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['iscs:plan:add']"
-          >新增
+        >新增
         </el-button>
       </el-col>
-      <!-- <el-col :span="1.5">
+       <el-col :span="1.5">
         <el-button
           v-no-more-click
           type="danger"
@@ -103,7 +108,7 @@
           v-hasPermi="['iscs:plan:remove']"
           >批量删除
         </el-button>
-      </el-col> -->
+      </el-col>
       <right-toolbar
         :showSearch.sync="showSearch"
         @queryTable="getList"
@@ -112,30 +117,29 @@
 
     <el-table
       v-loading="loading"
-      :data="materialsList"
+      :data="PlanList"
       @selection-change="handleSelectionChange"
     >
       <!-- <el-table-column type="selection" width="55" align="center" /> -->
-      <el-table-column label="计划编号" align="center" prop="checkId">
+      <el-table-column label="计划编号" align="center" prop="planId">
       </el-table-column>
-      <el-table-column label="计划名称" align="center" prop="checkName">
+      <el-table-column label="计划名称" align="center" prop="planName">
       </el-table-column>
-      <el-table-column label="检查物资柜" align="center" prop="workstationId">
+      <el-table-column label="巡检物资柜" align="center" prop="cabinetName">
+        <template slot-scope="scope">
+          <el-tooltip :content="scope.row.cabinetName" placement="top">
+            <span>{{ getDisplayText(scope.row.cabinetName) }}</span>
+          </el-tooltip>
+        </template>
       </el-table-column>
-
-      <!--      <el-table-column label="巡检物资柜" align="center" prop="cabinetIdStr">-->
-      <!--        <template slot-scope="scope">-->
-      <!--          <el-tag type="danger">{{ getCabinetName(scope.row.cabinetIdStr) }}</el-tag>-->
-      <!--        </template>-->
-      <!--      </el-table-column>-->
-      <el-table-column label="计划日期" align="center" prop="cron">
+      <el-table-column label="计划日期" align="center" prop="planDate">
         <template slot-scope="scope">
-          {{ cronDescription(scope.row.cron) }}
+          {{ scope.row.planDate }}
         </template>
       </el-table-column>
-      <el-table-column label="检察员" align="center" prop="userIdStr">
+      <el-table-column label="检察员" align="center" prop="checkUserName">
         <template slot-scope="scope">
-          <el-tag>{{ getUserName(scope.row.userIdStr) }}</el-tag>
+          {{ scope.row.checkUserName }}
         </template>
       </el-table-column>
       <el-table-column label="状态" align="center" prop="status">
@@ -164,17 +168,9 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['iscs:plan:query']"
-            >编辑
+          >编辑
           </el-button>
-          <!-- <el-button
-            v-no-more-click
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleResult(scope.row)"
-            v-hasPermi="['iscs:task:result']"
-            >结果记录
-          </el-button> -->
+
           <el-button
             v-no-more-click
             size="mini"
@@ -182,7 +178,7 @@
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['iscs:plan:remove']"
-            >删除
+          >删除
           </el-button>
         </template>
       </el-table-column>
@@ -190,7 +186,7 @@
     <pagination
       v-show="total > 0"
       :total="total"
-      :page.sync="queryParams.pages"
+      :page.sync="queryParams.current"
       :limit.sync="queryParams.size"
       @pagination="getList"
     />
@@ -201,13 +197,28 @@
         <span class="title">{{ title }}</span>
       </div>
       <el-form ref="form" :model="form" :rules="rules" label-width="110px">
-        <el-form-item label="任务名称" prop="checkName">
-          <el-input v-model="form.checkName" placeholder="请输入任务名称" />
+        <el-form-item label="计划名称" prop="planName">
+          <el-input v-model="form.planName" placeholder="请输入计划名称"/>
+        </el-form-item>
+        <el-form-item label="计划日期">
+          <el-date-picker
+            style="width: 350px"
+            v-model="form.planDate"
+            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="cabinetIdStr">
+        <el-form-item label="检查物资柜" prop="cabinetIds">
           <el-select
             style="width: 348px"
-            v-model="form.cabinetIdStr"
+            v-model="form.cabinetIds"
             placeholder="请选择需要检查的物资柜"
             multiple
             clearable
@@ -220,12 +231,11 @@
             />
           </el-select>
         </el-form-item>
-        <el-form-item label="检查人员" prop="userIdStr">
+        <el-form-item label="检察员" prop="checkUserId">
           <el-select
             style="width: 348px"
-            v-model="form.userIdStr"
-            placeholder="请选择检查人员"
-            multiple
+            v-model="form.checkUserId"
+            placeholder="请选择检察员"
             clearable
           >
             <el-option
@@ -236,95 +246,41 @@
             />
           </el-select>
         </el-form-item>
-        <el-form-item label="检查时间频率" prop="cron">
-          <el-input v-model="form.cron" placeholder="请点击生成表达式">
-            {{ form.co }}
-            <template slot="append">
-              <el-button v-no-more-click type="primary" @click="handleShowCron">
-                生成表达式
-                <i class="el-icon-time el-icon--right"></i>
-              </el-button>
-            </template>
-          </el-input>
-        </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>
-    <!--    检查日期表达式工具-->
-    <el-dialog
-      title="Cron表达式生成器"
-      :visible.sync="openCron"
-      append-to-body
-      destroy-on-close
-      class="scrollbar"
-    >
-      <crontab
-        @hide="openCron = false"
-        @fill="crontabFill"
-        :expression="expression"
-      ></crontab>
-    </el-dialog>
-    <!-- 检查结果-->
-    <el-dialog title="检查结果记录" :visible.sync="ResultVisible" width="50%">
-      <div class="info-bar">
-        <p>检查计划名称:{{ planName }}</p>
-        <p>物资柜编号:{{ cabinetId }}</p>
-        <p>检查时间:{{ inspectionDate }}</p>
-        <p>巡检人:{{ inspector }}</p>
-      </div>
-      <el-table :data="items" border>
-        <el-table-column prop="name" label="物资名称" width="200" />
-        <el-table-column prop="id" label="物资编号" width="150" />
-        <el-table-column label="物资状态" width="200">
-          <template slot-scope="scope">
-            <el-select v-model="scope.row.status" placeholder="请选择">
-              <el-option label="正常" value="正常" />
-              <el-option label="破损" value="破损" />
-              <el-option label="丢失" value="丢失" />
-              <el-option label="过期" value="过期" />
-            </el-select>
-          </template>
-        </el-table-column>
-        <el-table-column label="备注">
-          <template slot-scope="scope">
-            <el-input v-model="scope.row.comment" placeholder="备注信息" />
-          </template>
-        </el-table-column>
-      </el-table>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">取消</el-button>
-        <el-button type="primary" @click="saveResults">保存</el-button>
-      </div>
-    </el-dialog>
+
+
   </div>
 </template>
 
 <script>
-import { getPlanPerson, getIsCheckTaskCabinets } from "@/api/mes/material/plan";
+
 import {
-  getPlanList,
+  listPlan,
   addPlan,
   deletePlan,
   updatePlan,
-  getPlanDetail,
-} from "@/api/mes/material/checkPlan";
-import { genCode } from "@/api/system/autocode/rule";
-import Crontab from "@/components/Crontab/index.vue";
-import cronstrue from "cronstrue/i18n";
-import Treeselect from "@riophae/vue-treeselect";
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-import { listMarsDept } from "@/api/system/marsdept";
+  selectPlanById
+} from '@/api/mes/material/plan'
+import Crontab from '@/components/Crontab/index.vue'
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import { listMarsDept } from '@/api/system/marsdept'
+import { getIsMaterialsCabinets } from '@/api/mes/material/information'
+import { listUser } from '@/api/system/user'
 
 export default {
-  name: "Team",
+  name: 'Team',
   components: { Treeselect, Crontab },
-  dicts: ["material_status", "checking_status"],
+  dicts: ['material_status', 'checking_status'],
   data() {
     return {
       //自动生成编码
@@ -344,325 +300,280 @@ export default {
       // 总条数
       total: 0,
       // 班组表格数据
-      materialsList: [],
-      // mars树选项
-      marsOptions: [],
+      PlanList: [],
       // 弹出层标题
-      title: "",
+      title: '',
       // 是否显示弹出层
       open: false,
-      // 是否显示Cron表达式弹出层
-      openCron: false,
-      // 传入的表达式
-      expression: "",
       // 查询参数
-      createTime: "",
+      createTime: '',
       queryParams: {
         current: 1,
         size: 10,
-        // materialsCode: null,
-        // materialsName: null,
-        // loanState: null,
-        // materialsCabinetId: null,
-        // materialsTypeId: null,
-        // startTime: "",
-        // endTime: "",
+        checkUserName:'',
+        planName:'',
+        cabinetId:'',
+        startTime:null,
+        endTime:null,
       },
-
-      // 查询参数
-      queryParamsCabinets: {
-        current: 1,
-        size: -1,
-      },
-
       // 表单参数
       form: {},
-
       cabinets: [], //物资所属柜
       planPersonOption: [], // 检查人员
+      workstationOption: [],//所属岗位
       // 表单校验
       rules: {
         userIdStr: [
-          { required: true, message: "人员不能为空", trigger: "blur" },
+          { required: true, message: '人员不能为空', trigger: 'blur' }
         ],
         checkName: [
-          { required: true, message: "任务名称不能为空", trigger: "blur" },
-        ],
-        cron: [
-          { required: true, message: "检查时间频率不能为空", trigger: "blur" },
-        ],
+          { required: true, message: '任务名称不能为空', trigger: 'blur' }
+        ]
+
       },
-      ResultVisible: false, //检查结果弹窗标志
-      planName: "每月物资检查计划",
-      cabinetId: "柜子001",
-      inspectionDate: "2024-12-15",
-      inspector: "张三",
-      items: [
-        { name: "安全帽", id: "A001", status: "正常", comment: "" },
-        { name: "消防器材", id: "B002", status: "正常", comment: "" },
-      ],
       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])
+            }
+          }
+        ]
+      }
+    }
+  },
+  watch:{
+    'form.workstationId':function(newVal, oldVal) {
+      if (newVal) {
+        console.log(newVal,'gangwei ')
+        const data = {
+          current: 1,
+          size: -1,
+          workstationId: newVal,
+        }
+        getIsMaterialsCabinets(data).then((response) => {
+          console.log(response,'wgahah')
+          if (response?.data?.records) {
+            this.cabinets = response.data.records.map((item) => ({
+              value: item.cabinetId,
+              label: item.cabinetName
+            }))
+          }
+        })
+      }
+    }
   },
   created() {
-    this.getList();
-    this.materialsCabinets();
+    this.getList()
+    this.getOtherList()
   },
 
   methods: {
-    cronDescription(cron) {
-      return cronstrue.toString(cron, { locale: "zh_CN" });
+// 格式化日期查询数据
+    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;
+      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]);
+        this.queryParams.startTime = this.formatDate(this.createTime[0])
+        this.queryParams.endTime = this.formatDate(this.createTime[1])
       }
-      getPlanList(this.queryParams).then((response) => {
-        console.log(response, "获取物资信息allList ");
-        this.materialsList = response.data.records;
-        this.total = response.data.total;
+      listPlan(this.queryParams).then((response) => {
+        console.log(response, '获取物资信息allList ')
+        this.PlanList = response.data.records
+        this.total = response.data.total
         this.machinerytypeList = this.handleTree(
           response.data.records,
-          "materialsTypeId",
-          "parentId",
-          "children"
-        );
-        this.loading = false;
-      });
+          'materialsTypeId',
+          'parentId',
+          'children'
+        )
+        this.loading = false
+      })
     },
-    // 物资所属柜
-    materialsCabinets() {
-      getIsCheckTaskCabinets(this.queryParamsCabinets).then((response) => {
+
+    getOtherList() {
+      const data = {
+        current: 1,
+        size: -1,
+      }
+      getIsMaterialsCabinets(data).then((response) => {
         if (response?.data?.records) {
-          // 提取 cabinetId 和 cabinetName
           this.cabinets = response.data.records.map((item) => ({
             value: item.cabinetId,
-            label: item.cabinetName,
-          }));
+            label: item.cabinetName
+          }))
         }
-        // 岗位查询
-        const data1 = {
-          pasge: 1,
-          size: -1,
-        };
-        listMarsDept(data1).then((response) => {
-          this.marsOptions = this.handleTree(
-            response.data.records,
-            "workstationId",
-            "parentId"
-          );
-        });
-      });
-      // 巡检人员
-      const data = {
-        pageNum: 1,
-        pageSize: 99999,
-      };
-      getPlanPerson(data).then((res) => {
-        console.log(res, "巡检人员信息");
+      })
+      const data1 = {
+        pageSize: 999999999,
+        pageNum: 1
+      }
+      listUser(data1).then((res) => {
         this.planPersonOption = res.rows.map((item) => {
           return {
             label: item.nickName,
-            value: item.userId,
-          };
-        });
-      });
+            value: item.userId
+          }
+        })
+      })
+      listMarsDept(data).then(res => {
+        this.workstationOption = this.handleTree(res.data.records, 'workstationId', 'parentId')
+      })
     },
     normalizer(node) {
       if (node.children && !node.children.length) {
-        delete node.children;
+        delete node.children
       }
       return {
         id: node.workstationId,
         label: node.workstationName,
-        children: node.children,
-      };
+        children: node.children
+      }
+    },
+    /* 物资柜信息转换展示 */
+    getDisplayText(cabinetName) {
+      const names = cabinetName.split(',');
+      if(names.length ==1) {
+        return `${names.length}个 (${names[0]})`;
+      }
+      if (names.length > 1) {
+        return `${names.length}个 (${names[0]}...)`;
+      }
+      return names[0];
+    },
+    goto(){
+
     },
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.reset();
+      this.open = false
+      this.reset()
     },
     // 表单重置
     reset() {
       this.form = {
-        cron: undefined,
-      };
-      this.resetForm("form");
-      this.autoGenFlag = false;
+        planName:'',
+        cabinetIds:'',
+        workstationId:'',
+        checkUserName:'',
+      }
+      this.resetForm('form')
+      this.autoGenFlag = false
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pages = 1;
-      this.getList();
+      this.queryParams.current = 1
+      this.getList()
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
+      this.resetForm('queryForm')
+      this.queryParams.startTime = ''
+      this.queryParams.endTime = ''
+      this.createTime=''
+      this.handleQuery()
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.checkId);
-      this.single = selection.length !== 1;
-      this.multiple = !selection.length;
+      this.ids = selection.map((item) => item.planId)
+      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.form.workstationId=null
+      this.title = '新增检查计划'
+      this.optType = 'add'
     },
 
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset();
-      getPlanDetail(row.checkId).then((response) => {
-        this.form = response.data;
-        this.form.userIdStr = response.data.userIdStr.split(",");
-        this.form.cabinetIdStr = response.data.cabinetIdStr.split(",");
-        this.open = true;
-        this.title = "编辑检查计划";
-        this.optType = "edit";
-      });
+      this.reset()
+      selectPlanById(row.planId).then((response) => {
+        this.form = response.data
+        this.open = true
+        this.title = '编辑检查计划'
+        this.optType = 'edit'
+      })
     },
 
-    /** cron表达式按钮操作 */
-    handleShowCron() {
-      this.expression = this.form.cron;
-      this.openCron = true;
-    },
-    /** 确定后回传值 */
-    crontabFill(value) {
-      this.form.cron = value;
-    },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate((valid) => {
+      this.$refs['form'].validate((valid) => {
         if (valid) {
-          if (this.form.checkId != null) {
-            const data = {
-              checkId: this.form.checkId,
-              checkName: this.form.checkName,
-              cabinetIdStr: this.form.cabinetIdStr.join(","),
-              userIdStr: this.form.userIdStr.join(","),
-              cron: this.form.cron,
-            };
-            updatePlan(data).then((response) => {
-              console.log(response, "修改返回");
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
+          if (this.form.planId != null) {
+            updatePlan(this.form).then((response) => {
+              console.log(response, '修改返回')
+              this.$modal.msgSuccess('修改成功')
+              this.open = false
+              this.getList()
+            })
           } else {
-            const data = {
-              checkName: this.form.checkName,
-              cabinetIdStr: this.form.cabinetIdStr.join(","),
-              userIdStr: this.form.userIdStr.join(","),
-              cron: this.form.cron,
-            };
-            // console.log(data,'新增的参数');
-            addPlan(data).then((response) => {
-              console.log(response, "新增返回");
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
+            addPlan(this.form).then((response) => {
+              console.log(response, '新增返回')
+              this.$modal.msgSuccess('新增成功')
+              this.open = false
+              this.getList()
+            })
           }
         }
-      });
+      })
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const checkIds = row.checkId || this.ids;
+      const checkIds = row.planId || this.ids
 
       this.$modal
         .confirm('是否确认删除编号为"' + checkIds + '"的数据项?')
-        .then(function () {
-          return deletePlan(checkIds);
+        .then(function() {
+          return deletePlan(checkIds)
         })
         .then(() => {
-          this.getList();
-          this.$modal.msgSuccess("删除成功");
+          this.getList()
+          this.$modal.msgSuccess('删除成功')
         })
-        .catch(() => {});
-    },
-
-    //   检查结果 弹窗打开函数
-    handleResult() {
-      this.ResultVisible = true;
-    },
-
-    // 检查结果确认按钮
-    saveResults() {
-      // 提交检查结果逻辑
-      console.log(this.items);
-      this.dialogVisible = false;
-    },
-    // 表格转换用户名
-    getUserName(userIdStr) {
-      if (!userIdStr) return "";
-      const userIds = userIdStr.split(",").map(Number);
-      return userIds
-        .map((userId) => {
-          const user = this.planPersonOption.find(
-            (option) => option.value == userId
-          );
-          return user ? user.label : "";
-        })
-        .join(", ");
-    },
-    // 表格转换物资柜子
-    getCabinetName(cabinetIdStr) {
-      if (!cabinetIdStr) return "";
-      const cabinetIds = cabinetIdStr.split(",").map(Number);
-      return cabinetIds
-        .map((cabinetId) => {
-          const cabinet = this.cabinets.find(
-            (option) => option.value == cabinetId
-          );
-          return cabinet ? cabinet.label : "";
+        .catch(() => {
         })
-        .join(", ");
-    },
-  },
-};
+    }
+
+  }
+}
 </script>
 <style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
 .el-input-width {

+ 260 - 45
src/views/mes/material/replacementrecords/index.vue

@@ -108,11 +108,36 @@
         >
       </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-table
       v-loading="loading"
-      :data="materialsList"
+      :data="changeRecordList"
       @selection-change="handleSelectionChange"
     >
       <el-table-column type="selection" width="55" align="center"/>
@@ -154,7 +179,33 @@
           <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-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"
@@ -163,32 +214,144 @@
       :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="recordId">
+          <el-input
+            v-model="form.recordId"
+            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"
+            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 {
-  listCheckTask,
-  addCheckTask,
-  getPlanPerson,
-  updateCheckTask,
-  deleteCheckTask,
-  selectCheckTaskById,
-  getIsCheckTaskCabinets
-} from '@/api/mes/material/plan'
-import { genCode } from '@/api/system/autocode/rule'
-import Crontab from '@/components/Crontab/index.vue'
-import cronstrue from 'cronstrue/i18n';
+  listChangeRecord,addChangeRecord,updateChangeRecord,deleteChangeRecord,selectChangeRecordById
+} from '@/api/mes/material/replace'
+
 import Treeselect from '@riophae/vue-treeselect'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 import { listMarsDept } from '@/api/system/marsdept'
 import { listType } from '@/api/mes/material/typeindex'
 import Template from '@/views/print/printtemplate/list.vue'
-
+import { getIsMaterialsCabinets } from '@/api/mes/material/information'
+import { listUser } from '@/api/system/user'
+import { listPlan } from '@/api/mes/material/plan'
 export default {
   name: 'Team',
-  components: { Template, Treeselect, Crontab },
+  components: { Template, Treeselect },
   dicts: ['material_status','checking_status'],
   data() {
     return {
@@ -209,10 +372,11 @@ export default {
       // 总条数
       total: 0,
       // 班组表格数据
-      materialsList: [],
+      changeRecordList: [],
       // mars树选项
       marsOptions: [],
-
+      // 是否显示弹出层
+      open: false,
       // 查询参数
       createTime: '',
       queryParams: {
@@ -226,16 +390,11 @@ export default {
         startTime: '',
         endTime: ''
       },
-      // 查询参数
-      queryParamsCabinets: {
-        current: 1,
-        size: -1
-      },
-
       // 表单参数
       form: {},
       cabinets: [], //物资所属柜
       planPersonOption: [],// 检查人员
+      planList:[],//检查计划下拉
       // 表单校验
       rules: {
         userIdStr: [
@@ -299,16 +458,10 @@ export default {
         this.queryParams.startTime = this.formatDate(this.createTime[0])
         this.queryParams.endTime = this.formatDate(this.createTime[1])
       }
-      listCheckTask(this.queryParams).then((response) => {
+      listChangeRecord(this.queryParams).then((response) => {
         console.log(response, '获取物资信息allList ')
-        this.materialsList = response.data.records
+        this.changeRecordList = response.data.records
         this.total = response.data.total
-        this.machinerytypeList = this.handleTree(
-          response.data.records,
-          'materialsTypeId',
-          'parentId',
-          'children'
-        )
         this.loading = false
       })
 
@@ -331,30 +484,28 @@ export default {
     },
     /** 查询物资柜结构 */
     materialsCabinets() {
-      getIsCheckTaskCabinets(this.queryParamsCabinets).then((response) => {
+      const data1 = {
+        pasge: 1,
+        size: -1
+      }
+      getIsMaterialsCabinets(data1).then((response) => {
         if (response?.data?.records) {
-          // 提取 cabinetId 和 cabinetName
           this.cabinets = response.data.records.map((item) => ({
             value: item.cabinetId,
             label: item.cabinetName
           }))
         }
-        // 岗位查询
-        const data1 = {
-          pasge: 1,
-          size: -1
-        }
-        listMarsDept(data1).then((response) => {
-          this.marsOptions = this.handleTree(response.data.records,"workstationId","parentId")
-        })
+      })
+      // 岗位查询
+      listMarsDept(data1).then((response) => {
+        this.marsOptions = this.handleTree(response.data.records,"workstationId","parentId")
       })
       // 巡检人员
       const data = {
         pageNum: 1,
         pageSize: 99999
       }
-      getPlanPerson(data).then((res) => {
-        console.log(res, '巡检人员信息')
+      listUser(data).then((res) => {
         this.planPersonOption = res.rows.map((item) => {
           return {
             label: item.nickName,
@@ -362,6 +513,14 @@ export default {
           }
         })
       })
+      listPlan(data1).then((response) => {
+        this.planList = response.data.records.map((item) => {
+          return {
+            label: item.planName,
+            value: item.planId,
+          }
+        })
+      })
     },
     /** 查询岗位下拉树结构 */
     normalizer(node) {
@@ -406,11 +565,67 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.checkId)
+      this.ids = selection.map((item) => item.changeId)
       this.single = selection.length !== 1
       this.multiple = !selection.length
     },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset()
+      this.open = true
+      this.title = '新增更换记录'
+      this.optType = 'add'
+    },
+
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset()
+      selectChangeRecordById(row.changeId).then((response) => {
+        this.form = response.data
+        this.open = true
+        this.title = '编辑更换记录'
+        this.optType = 'edit'
+      })
+    },
+
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs['form'].validate((valid) => {
+        if (valid) {
+          if (this.form.changeId != null) {
+            updateChangeRecord(this.form).then((response) => {
+              console.log(response, '修改返回')
+              this.$modal.msgSuccess('修改成功')
+              this.open = false
+              this.getList()
+            })
+          } else {
+            addChangeRecord(this.form).then((response) => {
+              console.log(response, '新增返回')
+              this.$modal.msgSuccess('新增成功')
+              this.open = false
+              this.getList()
+            })
+          }
+        }
+      })
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const changeIds = row.changeId || this.ids
 
+      this.$modal
+        .confirm('是否确认删除编号为"' + changeIds + '"的数据项?')
+        .then(function() {
+          return deleteChangeRecord(changeIds)
+        })
+        .then(() => {
+          this.getList()
+          this.$modal.msgSuccess('删除成功')
+        })
+        .catch(() => {
+        })
+    },
 
 
 

+ 3 - 2
src/views/mes/md/segregationpoint/index.vue

@@ -929,9 +929,10 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const teamIds = row.pointId || this.ids
-      const pointcodes = row.pointCode || this.codes
+      // const pointcodes = row.pointCode || this.codes
+      // '是否确认删除隔离点编号为"' + pointcodes + '"的数据项?'
       this.$modal
-        .confirm('是否确认删除隔离点编号为"' + pointcodes + '"的数据项?')
+        .confirm('是否确认删除数据项?')
         .then(function() {
           return deleteIsIsolationPointByPointIds(teamIds)
         })