dedsudiyu 8 kuukautta sitten
vanhempi
commit
6ae3b72cd5

+ 1 - 1
src/api/commonality/permission.js

@@ -79,7 +79,7 @@ export function getDeptNoAuthList(data) {
 }
 
 /*=================================V3=================================*/
-//根据名称查询数据权限范围内的实验室(下拉列表)
+//根据名称查询实验室(下拉列表-无权限) subName
 export function subjectList(data) {
   return request({
     url: '/system/subject/getListByPower',

+ 68 - 2
src/views/hierarchicalControl/conditionsSettings/addPage.vue

@@ -86,6 +86,37 @@
               </el-option>
             </el-select>
           </el-form-item>
+          <el-form-item label="截止日期" prop="deadline">
+            <el-date-picker
+              style="width:260px;"
+              value-format="yyyy-MM-dd"
+              v-model="newData.deadline"
+              type="date"
+              placeholder="选择日期">
+            </el-date-picker>
+          </el-form-item>
+        </div>
+        <div>
+          <el-form-item label="实验室" prop="subId">
+            <el-select
+              style="width:260px;"
+              v-model="newData.subId"
+              filterable
+              remote
+              clearable
+              reserve-keyword
+              @change="selectChange"
+              @clear="selectClear"
+              placeholder="请选择实验地点"
+              :remote-method="subjectList">
+              <el-option
+                v-for="item in laboratoryOptions"
+                :key="item.subId"
+                :label="item.subName"
+                :value="item.subId">
+              </el-option>
+            </el-select>
+          </el-form-item>
         </div>
         <el-form-item label="管控描述" prop="manageDes">
           <el-input type="textarea" resize="none" style="width:630px;" show-word-limit
@@ -147,7 +178,8 @@
     getDeptDropList,
     laboratoryClassTypeGetList,
     laboratoryClassLevelGetList,
-    systemUserSelect
+    systemUserSelect,
+    subjectList
   } from '@/api/commonality/permission'
   import { laboratoryGradeManageAdd,laboratoryGradeManageUpdate } from "@/api/hierarchicalControl/index";
   export default {
@@ -164,6 +196,9 @@
           typeId: '',
           levelId: '',
           executionUserId: '',
+          subId:'',
+          subName:'',
+          deadline:'',
         },
         //下拉列表数据
         deptOptions: [],
@@ -197,6 +232,9 @@
           levelId: [
             { required: true, message: '请选择安全分级', trigger: 'blur' }
           ],
+          deadline: [
+            { required: true, message: '请选择截止日期', trigger: 'blur' }
+          ],
           executionUserId: [
             { required: true, message: '请选择执行人员', trigger: 'blur' }
           ]
@@ -211,7 +249,8 @@
         userName: '',
         userId: '',
         optionsUser: [],
-        shadeForm: {}
+        shadeForm: {},
+        laboratoryOptions:[],
       }
     },
     created() {
@@ -226,11 +265,35 @@
           userId:this.propsData.executionUserId,
           userName:this.propsData.executionUser,
         }]);
+        this.$set(this,'laboratoryOptions',[{
+          subId:this.propsData.subId,
+          subName:this.propsData.subName,
+        }]);
         this.$set(this.newData,'way',"1");
         this.$set(this.newData,'cycle',"1");
       }
     },
     methods: {
+      //懒加载实验室
+      subjectList(e){
+        subjectList({subName:e}).then(response => {
+          this.laboratoryOptions = response.data;
+        });
+      },
+      //实验室选择
+      selectChange(e){
+        let self = this;
+        for(let i=0;i<self.laboratoryOptions.length;i++){
+          if(self.laboratoryOptions[i].subId == e){
+            self.$set(self.newData,"subId",self.laboratoryOptions[i].subId);
+            self.$set(self.newData,"subName",self.laboratoryOptions[i].subName);
+          }
+        }
+      },
+      selectClear(){
+        this.$set(this.newData,"subId",'');
+        this.$set(this.newData,"subName",'');
+      },
       // 返回按钮
       backPage() {
         this.$parent.tableButton(6)
@@ -246,6 +309,9 @@
               typeId: this.newData.typeId, //分类ID
               levelId: this.newData.levelId, //分级ID
               executionUserId: this.newData.executionUserId, //执行人员ID
+              subId: this.newData.subId, //执行人员ID
+              subName: this.newData.subName, //执行人员ID
+              deadline: this.newData.deadline, //执行人员ID
               manageDes: this.newData.manageDes //管控描述
             }
             this.deptOptions.forEach((item)=>{

+ 27 - 6
src/views/hierarchicalControl/conditionsSettings/index.vue

@@ -54,20 +54,29 @@
       <div class="page-content-box">
         <el-table class="table-box" v-loading="loading" border :data="dataList">
           <el-table-column label="管控名称" prop="name"  show-overflow-tooltip/>
-          <el-table-column label="二级单位" prop="deptName" width="200" show-overflow-tooltip/>
-          <el-table-column label="安全分类" prop="typeName" width="200" show-overflow-tooltip/>
-          <el-table-column label="安全分级" prop="levelName" width="200" show-overflow-tooltip/>
-          <el-table-column label="执行状态" prop="status" width="120" show-overflow-tooltip>
+          <el-table-column label="二级单位" prop="deptName" width="160" show-overflow-tooltip/>
+          <el-table-column label="安全分类" prop="typeName" width="160" show-overflow-tooltip/>
+          <el-table-column label="安全分级" prop="levelName" width="160" show-overflow-tooltip/>
+          <el-table-column label="执行状态" prop="status" width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               <span :class="scope.row.status == 1?'colorA':'colorB'">{{scope.row.status == 1?'已执行':'未执行'}}</span>
             </template>
           </el-table-column>
-          <el-table-column label="创建人" prop="createUser" width="200" show-overflow-tooltip/>
-          <el-table-column label="创建时间" prop="createTime" width="200" show-overflow-tooltip>
+          <el-table-column label="创建人" prop="createUser" width="160" show-overflow-tooltip/>
+          <el-table-column label="实验室" prop="subName" width="160" show-overflow-tooltip>
+            <template slot-scope="scope">{{scope.row.subName?scope.row.subName:'--'}}</template>
+          </el-table-column>
+          <el-table-column label="创建时间" prop="createTime" width="150" show-overflow-tooltip>
             <template slot-scope="scope">
               <span>{{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
             </template>
           </el-table-column>
+          <el-table-column label="截止时间" prop="deadline" width="150" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span>{{ scope.row.deadline?parseTime(scope.row.deadline,"{y}-{m}-{d}"):'--' }}</span>
+              <span style="margin-left:5px;color:red;" v-if="scope.row.deadlineNum&&deadlineNum>scope.row.deadlineNum">已逾期</span>
+            </template>
+          </el-table-column>
           <el-table-column label="操作" width="140" show-overflow-tooltip>
             <template slot-scope="scope">
               <div class="table-button-box">
@@ -135,12 +144,16 @@
         total:0,
         //组件传参
         propsData:{},
+        deadlineNum:null,
       }
     },
     created () {
 
     },
     mounted () {
+      const now = new Date();
+      let yy = now.getFullYear()+'-'+now.getMonth()+'-'+now.getDate()
+      this.$set(this,'deadlineNum',new Date(yy).getTime());
       this.getDeptDropList();
       this.laboratoryClassTypeGetList();
       this.laboratoryClassLevelGetList();
@@ -168,6 +181,14 @@
       //获取数据列表
       getList(){
         laboratoryGradeManageList(this.queryParams).then(response => {
+          //返回时间戳
+          for(let i=0;i<response.data.records.length;i++){
+            if(response.data.records[i].deadline){
+              response.data.records[i].deadlineNum = new Date(response.data.records[i].deadline).getTime()
+            }else{
+              response.data.records[i].deadlineNum = false
+            }
+          }
           this.$set(this,'dataList',response.data.records);
           this.$set(this,'total',response.data.total);
         });

+ 27 - 6
src/views/hierarchicalControl/executeResult/index.vue

@@ -50,20 +50,29 @@
       <div class="page-content-box">
         <el-table class="table-box" v-loading="loading" border :data="dataList">
           <el-table-column label="管控名称" prop="name"  show-overflow-tooltip/>
-          <el-table-column label="二级单位" prop="deptName" width="200" show-overflow-tooltip/>
-          <el-table-column label="安全分类" prop="typeName" width="200" show-overflow-tooltip/>
-          <el-table-column label="安全分级" prop="levelName" width="200" show-overflow-tooltip/>
-          <el-table-column label="执行状态" prop="status" width="120" show-overflow-tooltip>
+          <el-table-column label="二级单位" prop="deptName" width="160" show-overflow-tooltip/>
+          <el-table-column label="安全分类" prop="typeName" width="160" show-overflow-tooltip/>
+          <el-table-column label="安全分级" prop="levelName" width="160" show-overflow-tooltip/>
+          <el-table-column label="执行状态" prop="status" width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               <span :class="scope.row.status == 1?'colorA':'colorB'">{{scope.row.status == 1?'已执行':'未执行'}}</span>
             </template>
           </el-table-column>
-          <el-table-column label="执行人" prop="executionUser" width="200" show-overflow-tooltip/>
-          <el-table-column label="执行时间" prop="executionTime" width="200" show-overflow-tooltip>
+          <el-table-column label="执行人" prop="executionUser" width="160" show-overflow-tooltip/>
+          <el-table-column label="实验室" prop="subName" width="160" show-overflow-tooltip>
+            <template slot-scope="scope">{{scope.row.subName?scope.row.subName:'--'}}</template>
+          </el-table-column>
+          <el-table-column label="执行时间" prop="executionTime" width="150" show-overflow-tooltip>
             <template slot-scope="scope">
               <span>{{ parseTime(scope.row.executionTime,"{y}-{m}-{d} {h}:{i}") }}</span>
             </template>
           </el-table-column>
+          <el-table-column label="截止时间" prop="deadline" width="150" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span>{{ scope.row.deadline?parseTime(scope.row.deadline,"{y}-{m}-{d}"):'--' }}</span>
+              <span style="margin-left:5px;color:red;" v-if="scope.row.deadlineNum&&deadlineNum>scope.row.deadlineNum">已逾期</span>
+            </template>
+          </el-table-column>
           <el-table-column label="操作" width="140" show-overflow-tooltip >
             <template slot-scope="scope">
               <div class="table-button-box">
@@ -129,12 +138,16 @@
         total:0,
         //组件传参
         propsData:{},
+        deadlineNum:null,
       }
     },
     created () {
 
     },
     mounted () {
+      const now = new Date();
+      let yy = now.getFullYear()+'-'+now.getMonth()+'-'+now.getDate()
+      this.$set(this,'deadlineNum',new Date(yy).getTime());
       this.getDeptDropList();
       this.laboratoryClassTypeGetList();
       this.laboratoryClassLevelGetList();
@@ -163,6 +176,14 @@
       //获取数据列表
       getList(){
         laboratoryGradeManageList(this.queryParams).then(response => {
+          //返回时间戳
+          for(let i=0;i<response.data.records.length;i++){
+            if(response.data.records[i].deadline){
+              response.data.records[i].deadlineNum = new Date(response.data.records[i].deadline).getTime()
+            }else{
+              response.data.records[i].deadlineNum = false
+            }
+          }
           this.$set(this,'dataList',response.data.records);
           this.$set(this,'total',response.data.total);
         });

+ 26 - 5
src/views/hierarchicalControl/workExecute/index.vue

@@ -50,20 +50,29 @@
       <div class="page-content-box">
         <el-table class="table-box" v-loading="loading" border :data="dataList">
           <el-table-column label="管控名称" prop="name"  show-overflow-tooltip/>
-          <el-table-column label="二级单位" prop="deptName" width="200" show-overflow-tooltip/>
-          <el-table-column label="安全分类" prop="typeName" width="200" show-overflow-tooltip/>
-          <el-table-column label="安全分级" prop="levelName" width="200" show-overflow-tooltip/>
-          <el-table-column label="执行状态" prop="status" width="120" show-overflow-tooltip>
+          <el-table-column label="二级单位" prop="deptName" width="160" show-overflow-tooltip/>
+          <el-table-column label="安全分类" prop="typeName" width="160" show-overflow-tooltip/>
+          <el-table-column label="安全分级" prop="levelName" width="160" show-overflow-tooltip/>
+          <el-table-column label="执行状态" prop="status" width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               <span :class="scope.row.status == 1?'colorA':'colorB'">{{scope.row.status == 1?'已执行':'未执行'}}</span>
             </template>
           </el-table-column>
           <el-table-column label="创建人" prop="createUser" width="200" show-overflow-tooltip/>
-          <el-table-column label="创建时间" prop="createTime" width="200" show-overflow-tooltip>
+          <el-table-column label="实验室" prop="subName" width="160" show-overflow-tooltip>
+            <template slot-scope="scope">{{scope.row.subName?scope.row.subName:'--'}}</template>
+          </el-table-column>
+          <el-table-column label="创建时间" prop="createTime" width="150" show-overflow-tooltip>
             <template slot-scope="scope">
               <span>{{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
             </template>
           </el-table-column>
+          <el-table-column label="截止时间" prop="deadline" width="150" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span>{{ scope.row.deadline?parseTime(scope.row.deadline,"{y}-{m}-{d}"):'--' }}</span>
+              <span style="margin-left:5px;color:red;" v-if="scope.row.deadlineNum&&deadlineNum>scope.row.deadlineNum">已逾期</span>
+            </template>
+          </el-table-column>
           <el-table-column label="操作" width="140" show-overflow-tooltip>
             <template slot-scope="scope">
               <div class="table-button-box">
@@ -135,12 +144,16 @@
         total:0,
         //组件传参
         propsData:{},
+        deadlineNum:null,
       }
     },
     created () {
 
     },
     mounted () {
+      const now = new Date();
+      let yy = now.getFullYear()+'-'+now.getMonth()+'-'+now.getDate()
+      this.$set(this,'deadlineNum',new Date(yy).getTime());
       this.getDeptDropList();
       this.laboratoryClassTypeGetList();
       this.laboratoryClassLevelGetList();
@@ -171,6 +184,14 @@
         let obj = JSON.parse(JSON.stringify(this.queryParams))
         obj.executionUserId = this.meUserId;
         laboratoryGradeManageList(obj).then(response => {
+          //返回时间戳
+          for(let i=0;i<response.data.records.length;i++){
+            if(response.data.records[i].deadline){
+              response.data.records[i].deadlineNum = new Date(response.data.records[i].deadline).getTime()
+            }else{
+              response.data.records[i].deadlineNum = false
+            }
+          }
           this.$set(this,'dataList',response.data.records);
           this.$set(this,'total',response.data.total);
         });