소스 검색

安全检查界面功能完善

jiawuxian 2 년 전
부모
커밋
7dd31a90a3

+ 14 - 1
src/api/safetycheck/register.js

@@ -5,13 +5,26 @@ export function info(id) {
   return request({
     url: "/core/safetycheck/register/" + id,
     method: "get",
+    showLoading:true
   });
 }
 
 // 登记信息
 export function submit(data) {
   return request({
-    url: "/core/safetycheck/register",
+    url: "/core/safetycheck/register/websubmit",
     method: "POST",
+    showLoading:true,
+    data
+  });
+}
+
+// 登记信息
+export function grant(data) {
+  return request({
+    url: "/core/safetycheck/register/grant",
+    method: "POST",
+    showLoading:true,
+    data
   });
 }

+ 5 - 1
src/components/orgTree/index.vue

@@ -56,7 +56,7 @@ export default {
       treeList: [],
       //默认选中节点
       defaultKeys: [],
-      checkSub: true,
+      checkSub: this.defuaultCheckSub,
       defaultKey: null,
     };
   },
@@ -85,6 +85,10 @@ export default {
       type: String,
       default: "请输入机构名称",
     },
+    defuaultCheckSub:{
+      type:Boolean,
+      default:true
+    }
   },
   watch: {
     // 根据名称筛选机构树

+ 2 - 1
src/components/userSelector/index.vue

@@ -17,6 +17,7 @@
             @defaultKey="getDefaultKey"
             @checkChange="checkChange"
             @click="clickTreeNode"
+            :defuaultCheckSub="search.checkSub"
           ></org-tree>
         </el-col>
         <el-col :span="18" :xs="24">
@@ -196,7 +197,7 @@ export default {
     emptySearch() {
       return {
         orgId: this.orgId,
-        checkSub: true,
+        checkSub: false,
         username: null,
         name: null,
       };

+ 28 - 29
src/views/check/task/index.vue

@@ -88,36 +88,36 @@
               ></el-option>
             </el-select>
           </el-form-item>
-          <el-row  >
-          <el-form-item label="受检机构" prop="orgName">
-            <!-- <el-input
+          <el-row>
+            <el-form-item label="受检机构" prop="orgName">
+              <!-- <el-input
                 v-model="queryParams.orgName"
                 placeholder="请输入受检机构"
                 clearable
                 @keyup.enter.native="handleQuery"
                 :maxlength="50" @input="inputRestriction"
               /> -->
-            <org-tree-select
-              v-model="queryParams.checkOrgIds"
-              ref="checkorgTreeSelect"
-              :disable="true"
-              @change="getList"
-            >
-            </org-tree-select>
-          </el-form-item>
-          <el-form-item style="margin-left: 50px">
-            <el-button
-              type="primary"
-              icon="el-icon-search"
-              size="mini"
-              @click="getList"
-              >搜索</el-button
-            >
-            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
-              >重置</el-button
-            >
-          </el-form-item>
-        </el-row>
+              <org-tree-select
+                v-model="queryParams.checkOrgIds"
+                ref="checkorgTreeSelect"
+                :disable="true"
+                @change="getList"
+              >
+              </org-tree-select>
+            </el-form-item>
+            <el-form-item style="margin-left: 50px">
+              <el-button
+                type="primary"
+                icon="el-icon-search"
+                size="mini"
+                @click="getList"
+                >搜索</el-button
+              >
+              <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+                >重置</el-button
+              >
+            </el-form-item>
+          </el-row>
         </el-form>
         <!--    按纽    -->
         <el-row :gutter="10" class="mb8">
@@ -395,10 +395,9 @@ export default {
     showscanRecord(row) {
       this.$refs.scanrecorddialog.show(row.id, row.orgId);
     },
-    showRegister(row){
-      let path="/core/safetycheck/register/1704797898023739393"     
-
-        this.$router.push(path)
+    showRegister(row) {
+      let path = "/core/safetycheck/register/" + row.id;
+      this.$router.push(path);
     },
     getDefaultKey(key) {
       this.queryParams.orgId = key;
@@ -422,7 +421,7 @@ export default {
       this.getList();
     },
     resetQuery() {
-      this.queryParams.checkOrgIds=[];
+      this.queryParams.checkOrgIds = [];
       this.resetForm("queryParams");
       this.getList();
     },

+ 18 - 10
src/views/safetycheck/taskManager/components/register.vue

@@ -8,7 +8,7 @@
         info.checkOrgName
       }}</el-descriptions-item>
       <el-descriptions-item label="受检机构">{{
-        info.beCheckOrgName
+        info.beCheckedOrgName
       }}</el-descriptions-item>
       <el-descriptions-item label="检查角色"
         >{{ info.checkRoleNames }}
@@ -40,7 +40,7 @@
       >
     </div>
     <div class="content">
-      <div class="area_content" v-for="area in info.areaList">
+      <div class="area_content" v-for="area in info.checkList">
         <div>
           {{ area.areaName }}
         </div>
@@ -77,6 +77,7 @@
                       v-model="point.remark"
                       style="width: 250px"
                       placeholder="请输入情况描述"
+                      maxlength="255"
                     ></el-input>
                   </el-form-item>
                   <el-form-item label="异常图片" prop="image">
@@ -159,7 +160,7 @@ export default {
     dayjs,
     onAddPoint() {
       this.pointIdsWhenAdd = [];
-      this.info.areaList.forEach((a) => {
+      this.info.checkList.forEach((a) => {
         a.itemList.forEach((i) => {
           i.pointList.forEach((p) => {
             this.pointIdsWhenAdd.push(p.pointId);
@@ -176,10 +177,10 @@ export default {
           continue;
         }
         let info = this.info;
-        let area = info.areaList.find((a) => a.areaId === p.areaId);
+        let area = info.checkList.find((a) => a.areaId === p.areaId);
         if (!area) {
           area = { areaId: p.areaId, areaName: p.areaName, itemList: [] };
-          info.areaList.push(area);
+          info.checkList.push(area);
         }
 
         let item = area.itemList.find((i) => i.itemId == p.itemId);
@@ -229,8 +230,8 @@ export default {
       }
 
       if (area.itemList.length === 0) {
-        index = this.info.areaList.indexOf(area);
-        this.info.areaList.splice(index, 1);
+        index = this.info.checkList.indexOf(area);
+        this.info.checkList.splice(index, 1);
       }
     },
     onImageChanged(point, value) {
@@ -244,14 +245,21 @@ export default {
             return;
         }
 
-        debugger
+        api.grant({planId:this.info.planId,
+            beCheckedOrgId:this.info.beCheckedOrgId,
+            taskId:this.info.id,
+            ymdDate:this.info.ymdDate,
+            userId:selected[0].id
+        }).then(r=>{
+            this.$message.info("授权成功")
+        })
         //调用授权
     },
     onGrant() {
         this.$refs.UserSelector.show();
     },
     onSave() {
-      this.info.isSubmit = false;
+      this.info.isSubmit = 0;
       api.submit(this.info).then((r) => {
         this.$message.info("保存成功");
       });
@@ -270,7 +278,7 @@ export default {
         }
       }
       if (isOk) {
-        this.info.isSubmit = true;
+        this.info.isSubmit = 1;
         api.submit(info);
       }
     },