Browse Source

人员与岗位数据丢失修复

pm 9 tháng trước cách đây
mục cha
commit
b28b4b713c

+ 1 - 1
src/views/mes/dv/technology/technologyDetail/CraftDetail.vue

@@ -532,7 +532,7 @@ export default {
         children: node.children
       }
     },
-    /** 转换mars岗位数据结构 */
+    /** 转换mars设备工艺数据结构 */
     normalizer(node) {
       if (node.children && !node.children.length) {
         delete node.children

+ 107 - 26
src/views/mes/material/inspectionplan/index.vue

@@ -8,31 +8,49 @@
       v-show="showSearch"
       label-width="100px"
     >
-      <el-form-item label="物资编码" prop="materialsCode">
+      <el-form-item label="计划名称" prop="materialsCode">
         <el-input
           v-model="queryParams.materialsCode"
-          placeholder="请输入物资编码"
+          placeholder="请输入计划名称"
           clearable
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="物资名称" prop="materialsName">
+      <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="materialsName">
         <el-input
           v-model="queryParams.materialsName"
-          placeholder="请输入物资名称"
+          placeholder="请输入检察员"
           clearable
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-
-      <el-form-item label="所属柜" prop="materialsCabinetId">
-        <el-select
-          style="width: 348px"
-          v-model="queryParams.materialsCabinetId"
-          placeholder="请选择所属柜"
+      <el-form-item label="计划日期">
+        <el-date-picker
+          style="width: 300px"
+          :default-time="['00:00:00', '23:59:59']"
+          v-model="restitutionTime"
+          type="datetimerange"
+          :picker-options="pickerOptions"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          align="right"
         >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="状态">
           <el-option
-            v-for="dict in cabinets"
+            v-for="dict in dict.type.checking_status"
             :key="dict.value"
             :label="dict.label"
             :value="dict.value"
@@ -99,21 +117,24 @@
       @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="checkId">
       </el-table-column>
-      <el-table-column label="巡检人" align="center" prop="userIdStr">
-        <template slot-scope="scope">
-          <el-tag>{{ getUserName(scope.row.userIdStr) }}</el-tag>
-
-        </template>
+      <el-table-column label="计划名称" align="center" prop="checkName">
+      </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="userIdStr">
         <template slot-scope="scope">
-          <el-tag type="danger">{{ getCabinetName(scope.row.cabinetIdStr) }}</el-tag>
+          <el-tag>{{ getUserName(scope.row.userIdStr) }}</el-tag>
         </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="巡检时间"
+        label="计划日期"
         align="center"
         prop="cron"
       >
@@ -121,7 +142,15 @@
           {{ cronDescription(scope.row.cron) }}
         </template>
       </el-table-column>
-      <el-table-column label="创建时间" align="center" prop="createTime">
+      <el-table-column label="状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.checking_status" :value="scope.row.status"/>
+        </template>
+      </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="操作"
@@ -284,12 +313,14 @@ import {
 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'
 
 export default {
   name: 'Team',
-  components: { Crontab },
-
-  dicts: ['material_status'],
+  components: { Treeselect, Crontab },
+  dicts: ['material_status','checking_status'],
   data() {
     return {
       //自动生成编码
@@ -310,6 +341,8 @@ export default {
       total: 0,
       // 班组表格数据
       materialsList: [],
+      // mars树选项
+      marsOptions: [],
       // 弹出层标题
       title: '',
       // 是否显示弹出层
@@ -356,7 +389,6 @@ export default {
         ]
 
       },
-
       ResultVisible: false,//检查结果弹窗标志
       planName: '每月物资检查计划',
       cabinetId: '柜子001',
@@ -365,7 +397,38 @@ export default {
       items: [
         { name: '安全帽', id: 'A001', status: '正常', comment: '' },
         { name: '消防器材', id: 'B002', status: '正常', comment: '' }
-      ]
+      ],
+      pickerOptions: {
+        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]);
+            },
+          },
+        ],
+      },
     }
   },
   created() {
@@ -409,6 +472,14 @@ 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 = {
@@ -425,6 +496,16 @@ export default {
         })
       })
     },
+    normalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children
+      }
+      return {
+        id: node.workstationId,
+        label: node.workstationName,
+        children: node.children
+      }
+    },
     // 取消按钮
     cancel() {
       this.open = false

+ 5 - 4
src/views/system/mars/index.vue

@@ -374,14 +374,15 @@ watch: {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset()
+      listMarsDept(row.workstationId).then(response => {
+        this.deptOptions = this.handleTree(response.data.records,"workstationId","parentId")
+      })
       getMarsDept(row.workstationId).then(response => {
-        this.form = response.data
+        this.form=response.data
         this.open = true
         this.title = '修改岗位'
       })
-      listMarsDeptExcludeChild(row.workstationId).then(response => {
-        this.deptOptions = this.handleTree(response.data.records,"workstationId","parentId")
-      })
+
     },
     /** 提交按钮 */
     submitForm: function() {

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

@@ -558,6 +558,13 @@ export default {
       this.initPassword = response.msg;
     });
   },
+  beforeRouteEnter(to, from, next) {
+    next(vm => {
+      vm.getOtherList();
+      vm.getList()
+      vm.getTreeselect();
+    });
+  },
   methods: {
     /** 查询用户列表 */
     getList() {