zhaozhipeng 3 years ago
parent
commit
0e6e1c339c
4 changed files with 192 additions and 121 deletions
  1. 98 89
      package-lock.json
  2. 11 1
      src/common/api.js
  3. 3 3
      src/common/request.js
  4. 80 28
      src/pages/index/index.vue

+ 98 - 89
package-lock.json

@@ -2997,16 +2997,6 @@
           "integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=",
           "dev": true
         },
-        "ansi-styles": {
-          "version": "4.3.0",
-          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
-          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "color-convert": "^2.0.1"
-          }
-        },
         "cacache": {
           "version": "13.0.1",
           "resolved": "https://registry.npm.taobao.org/cacache/download/cacache-13.0.1.tgz?cache=0&sync_timestamp=1616431156987&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcacache%2Fdownload%2Fcacache-13.0.1.tgz",
@@ -3033,34 +3023,6 @@
             "unique-filename": "^1.1.1"
           }
         },
-        "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "ansi-styles": "^4.1.0",
-            "supports-color": "^7.1.0"
-          }
-        },
-        "color-convert": {
-          "version": "2.0.1",
-          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
-          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "color-name": "~1.1.4"
-          }
-        },
-        "color-name": {
-          "version": "1.1.4",
-          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
-          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
-          "dev": true,
-          "optional": true
-        },
         "find-cache-dir": {
           "version": "3.3.1",
           "resolved": "https://registry.npm.taobao.org/find-cache-dir/download/find-cache-dir-3.3.1.tgz?cache=0&sync_timestamp=1583734806517&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffind-cache-dir%2Fdownload%2Ffind-cache-dir-3.3.1.tgz",
@@ -3098,13 +3060,6 @@
             "slash": "^2.0.0"
           }
         },
-        "has-flag": {
-          "version": "4.0.0",
-          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
-          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
-          "dev": true,
-          "optional": true
-        },
         "hash-sum": {
           "version": "2.0.0",
           "resolved": "https://registry.npm.taobao.org/hash-sum/download/hash-sum-2.0.0.tgz",
@@ -3117,28 +3072,6 @@
           "integrity": "sha1-dQ49tYYgh7RzfrrIIH/9HvJ7Jfw=",
           "dev": true
         },
-        "json5": {
-          "version": "2.2.0",
-          "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz",
-          "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "minimist": "^1.2.5"
-          }
-        },
-        "loader-utils": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
-          "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "big.js": "^5.2.2",
-            "emojis-list": "^3.0.0",
-            "json5": "^2.1.2"
-          }
-        },
         "locate-path": {
           "version": "5.0.0",
           "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz?cache=0&sync_timestamp=1597082033698&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flocate-path%2Fdownload%2Flocate-path-5.0.0.tgz",
@@ -3223,16 +3156,6 @@
             "minipass": "^3.1.1"
           }
         },
-        "supports-color": {
-          "version": "7.2.0",
-          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
-          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "has-flag": "^4.0.0"
-          }
-        },
         "terser-webpack-plugin": {
           "version": "2.3.8",
           "resolved": "https://registry.npm.taobao.org/terser-webpack-plugin/download/terser-webpack-plugin-2.3.8.tgz?cache=0&sync_timestamp=1610194262897&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fterser-webpack-plugin%2Fdownload%2Fterser-webpack-plugin-2.3.8.tgz",
@@ -3249,18 +3172,6 @@
             "terser": "^4.6.12",
             "webpack-sources": "^1.4.3"
           }
-        },
-        "vue-loader-v16": {
-          "version": "npm:vue-loader@16.2.0",
-          "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.2.0.tgz",
-          "integrity": "sha512-TitGhqSQ61RJljMmhIGvfWzJ2zk9m1Qug049Ugml6QP3t0e95o0XJjk29roNEiPKJQBEi8Ord5hFuSuELzSp8Q==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "chalk": "^4.1.0",
-            "hash-sum": "^2.0.0",
-            "loader-utils": "^2.0.0"
-          }
         }
       }
     },
@@ -15837,6 +15748,104 @@
         "vue-style-loader": "^4.1.0"
       }
     },
+    "vue-loader-v16": {
+      "version": "npm:vue-loader@16.2.0",
+      "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.2.0.tgz",
+      "integrity": "sha512-TitGhqSQ61RJljMmhIGvfWzJ2zk9m1Qug049Ugml6QP3t0e95o0XJjk29roNEiPKJQBEi8Ord5hFuSuELzSp8Q==",
+      "dev": true,
+      "optional": true,
+      "requires": {
+        "chalk": "^4.1.0",
+        "hash-sum": "^2.0.0",
+        "loader-utils": "^2.0.0"
+      },
+      "dependencies": {
+        "ansi-styles": {
+          "version": "4.3.0",
+          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-convert": "^2.0.1"
+          }
+        },
+        "chalk": {
+          "version": "4.1.1",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
+          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
+          }
+        },
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-name": "~1.1.4"
+          }
+        },
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+          "dev": true,
+          "optional": true
+        },
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+          "dev": true,
+          "optional": true
+        },
+        "hash-sum": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz",
+          "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==",
+          "dev": true,
+          "optional": true
+        },
+        "json5": {
+          "version": "2.2.0",
+          "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz",
+          "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "minimist": "^1.2.5"
+          }
+        },
+        "loader-utils": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
+          "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "big.js": "^5.2.2",
+            "emojis-list": "^3.0.0",
+            "json5": "^2.1.2"
+          }
+        },
+        "supports-color": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "has-flag": "^4.0.0"
+          }
+        }
+      }
+    },
     "vue-style-loader": {
       "version": "4.1.3",
       "resolved": "https://registry.npm.taobao.org/vue-style-loader/download/vue-style-loader-4.1.3.tgz?cache=0&sync_timestamp=1614758618345&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-style-loader%2Fdownload%2Fvue-style-loader-4.1.3.tgz",

+ 11 - 1
src/common/api.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-06-07 20:26:31
- * @LastEditTime: 2021-06-16 09:20:16
+ * @LastEditTime: 2021-06-16 19:00:26
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \ld-pad\src\common\api.js
@@ -121,4 +121,14 @@ export function solveAbnormal(data) {
 // 异常 - 解决异常问题
 export function patrolUpdate(data) {
 	return request('post', "/mobile/longDyPlan/patrolUpdate",data)
+}
+
+// 巡视列表 - 扫码 - 返回请求
+export function patrolScan(data) {
+	return request('post', "/mobile/longDyPlan/patrolScan",data)
+}
+
+// 巡视列表 - 扫码 - 返回请求
+export function dutyPatrolScan(data) {
+	return request('post', "/mobile/longDyPlan/dutyPatrolScan",data)
 }

+ 3 - 3
src/common/request.js

@@ -1,16 +1,16 @@
 /*
  * @Author: your name
  * @Date: 2021-06-07 20:26:31
- * @LastEditTime: 2021-06-15 18:28:24
+ * @LastEditTime: 2021-06-16 19:37:37
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \ld-pad\src\common\request.js
  */
 // const baseUrl = 'http://39.100.230.190'
 // const baseUrl = 'http://8.140.188.124'
-const baseUrl = 'http://172.18.0.24:40046'
+// const baseUrl = 'http://172.18.0.24:40046'
 // const baseUrl =  'http://172.18.1.227:40046'
-// const baseUrl =  'https://s2t.jihengcc.cn/'
+const baseUrl =  'https://s2t.jihengcc.cn/'
 // const baseUrl = ''
 
 // import { showLoading,hideLoading } from './loading.js'

+ 80 - 28
src/pages/index/index.vue

@@ -1,11 +1,3 @@
-<!--
- * @Author: your name
- * @Date: 2021-06-07 20:26:31
- * @LastEditTime: 2021-06-16 09:24:29
- * @LastEditors: Please set LastEditors
- * @Description: In User Settings Edit
- * @FilePath: \ld-pad\src\pages\index\index.vue
--->
 <template>
   <view class="content">
     <view class="content-left">
@@ -69,6 +61,7 @@
           src="../../static/sao.png"
           style="width: 40rpx; height: 40rpx; margin-left: auto"
           mode=""
+          @click="sao"
         ></image>
       </view>
       <view class="d-flex a-center j-sb f-w-900" style="height: 100%">
@@ -129,11 +122,7 @@
               <view class="u-m-l-6 f-18">{{ iten.name }}</view>
             </view>
           </view>
-          <view
-            v-else
-            class="u-m-t-14 f-18 content-right-item"
-            @click="infoStatus = 2"
-          >
+          <view v-else class="u-m-t-14 f-18 content-right-item">
             <text v-if="item.chu || !item.recordList.length">无相关记录表</text>
             <text v-else>点击显示记录表</text>
           </view>
@@ -522,9 +511,11 @@
       :zoom="false"
       width="80%"
     >
-      <view class="d-flex a-center j-end" @click="headerStatus = false"
-        ><u-icon name="close-circle-fill" color="#A9A3D2" size="30"></u-icon
-      ></view>
+      <view class="d-flex a-center j-end" @click="headerStatus = false">
+        <view class="u-m-r-8">
+          <u-icon name="close-circle-fill" color="#A9A3D2" size="30"></u-icon>
+        </view>
+      </view>
       <view slot="default" class="u-p-b-10 f-25">
         <u-row class="u-m-b-20">
           <u-col :offset="1" :span="3">
@@ -609,7 +600,9 @@ import {
   patrolWaitDetails,
   patrolSubmit,
   solveAbnormal,
-  patrolUpdate
+  patrolUpdate,
+  patrolScan,
+  dutyPatrolScan,
 } from "@/common/api.js";
 export default {
   components: {
@@ -836,7 +829,6 @@ export default {
         this.fcRcordNum = 0;
         this.rightData = info;
       }
-      console.log(info);
     },
     showInfo(id, type, name) {
       // 首件: 记录当前记录表id
@@ -855,14 +847,19 @@ export default {
     },
     // 巡检详情
     patrolWaitInfo() {
+      this.getPatrolWaitDetails(this.fcType, this.sjRecordId);
+    },
+    getPatrolWaitDetails(type, id) {
       patrolWaitDetails({
-        status: this.fcType,
-        versionId: this.sjRecordId,
+        status: type,
+        versionId: id,
       }).then((res) => {
         let data = res.data;
         if (res.status === "20000") {
           this.fcHeadData = [];
+          this.datafc = [];
           // 备注
+          this.infoStatus = 4;
           this.spannerRemark = data.remark;
           // 备注按钮 1.正常 2.异常 3.停用
           this.useSpanner = data.readIssue;
@@ -909,7 +906,12 @@ export default {
     // 返回到流程页
     returnFlowInfo() {
       this.infoStatus = 2;
-      this.getDutyPlanInfo(this.sjRecordId);
+      dutyPlanInfo({ versionId: this.sjRecordId, type: this.fcType }).then(
+        (res) => {
+          this.procedureRes = res.data.procedureRes;
+          this.everyId = res.data.everyId;
+        }
+      );
     },
     // 责任人流程下点检项
     getDutyPlanInfo() {
@@ -1113,14 +1115,14 @@ export default {
               this.infoStatus = 2;
               dutyPlanInfo({
                 versionId: this.sjRecordId,
-                type: this.fcType,
+                type: 2,
               }).then((res) => {
                 this.procedureRes = res.data.procedureRes;
                 this.everyId = res.data.everyId;
               });
             } else {
               this.infoStatus = 1;
-              this.submitClickStatusFc = 1
+              this.submitClickStatusFc = 1;
               proofingQuery().then((res) => {
                 if (res.status === "20000") {
                   this.cleanListData(res, 1);
@@ -1142,7 +1144,9 @@ export default {
         };
         if (this.fcType === 1) {
           patrolSubmit(data).then((res) => {
-            if (res.status === "50000") {
+            if (res.status === "20000") {
+              this.successCase("操作成功");
+              this.infoStatus = 1;
               this.fcIndex = 0;
               this.init();
             } else {
@@ -1151,7 +1155,8 @@ export default {
           });
         } else if (this.fcType === 2) {
           patrolUpdate(data).then((res) => {
-            if (res.status === "50000") {
+            if (res.status === "20000") {
+              this.successCase("操作成功");
               this.fcIndex = 0;
               this.init();
             } else {
@@ -1159,14 +1164,16 @@ export default {
             }
           });
         } else {
-          solveAbnormal({versionId:this.sjRecordId}).then(res=>{
-            if (res.status === "50000") {
+          solveAbnormal({ versionId: this.sjRecordId }).then((res) => {
+            if (res.status === "20000") {
+              this.successCase("操作成功");
+              this.infoStatus = 1;
               this.fcIndex = 0;
               this.init();
             } else {
               this.hintCase(res.message);
             }
-          })
+          });
         }
       }
     },
@@ -1315,6 +1322,16 @@ export default {
         type: "error",
       });
     },
+    successCase(msg) {
+      setTimeout(
+        () =>
+          this.$refs.uToast.show({
+            title: msg,
+            type: "success",
+          }),
+        800
+      );
+    },
     // 获取设备操作系统
     getSystem() {
       let platform = "";
@@ -1325,6 +1342,41 @@ export default {
       });
       return platform;
     },
+    sao() {
+      uni.scanCode({
+        onlyFromCamera: true,
+        success: function (res) {
+          console.log(res);
+          let no = res
+          if (!this.role) {
+            patrolScan({ id: no }).then((res) => {
+              if (res.status === "20000") {
+                let data = res.data;
+                this.getPatrolWaitDetails(data.status, data.versionId);
+              } else {
+                this.hintCase(res.message);
+              }
+            });
+          } else {
+            dutyPatrolScan(no).then((res) => {
+              if (res.status === "20000") {
+                let data = res.data;
+                dutyPlanInfo({
+                  versionId: data.versionId,
+                  type: data.type,
+                }).then((res) => {
+                  this.infoStatus = 2;
+                  this.procedureRes = res.data.procedureRes;
+                  this.everyId = res.data.everyId;
+                });
+              } else {
+                this.hintCase(res.message);
+              }
+            });
+          }
+        },
+      });
+    },
   },
 };
 </script>