浏览代码

feature:核查详情-文件上传

梦辉 1 年之前
父节点
当前提交
c7347de4b9
共有 45 个文件被更改,包括 1880 次插入997 次删除
  1. 95 86
      package-lock.json
  2. 1 1
      src/api/alarm.js
  3. 83 2
      src/api/commitment.js
  4. 1 1
      src/api/control.js
  5. 1 1
      src/api/family.js
  6. 0 350
      src/api/fetch.js
  7. 1 1
      src/api/help.js
  8. 1 1
      src/api/map.js
  9. 1 1
      src/api/notice.js
  10. 1 1
      src/api/place.js
  11. 1 1
      src/api/rent.js
  12. 1 1
      src/api/scanCode.js
  13. 10 1
      src/api/system.js
  14. 1 1
      src/api/user.js
  15. 1 1
      src/api/wx.js
  16. 10 0
      src/api/zlbApi.js
  17. 2 0
      src/components/common-upload/README.md
  18. 62 0
      src/components/common-upload/index.vue
  19. 10 63
      src/pages.json
  20. 17 13
      src/pages/blank/blank.vue
  21. 二进制
      src/static/images/commitment/bg2.png
  22. 20 45
      src/store/modules/template.js
  23. 329 102
      src/subPages/pages/commitment/commitmentDetail/components/IndicatorComponents.vue
  24. 2 7
      src/subPages/pages/commitment/commitmentDetail/components/InputComponents.vue
  25. 4 46
      src/subPages/pages/commitment/commitmentDetail/index.vue
  26. 1 1
      src/subPages/pages/commitment/enterpriseCommitment/components/number-list/index.vue
  27. 1 1
      src/subPages/pages/commitment/enterpriseCommitment/index.vue
  28. 90 0
      src/subPages/pages/commitment/home/components/contentMenu/index.vue
  29. 125 0
      src/subPages/pages/commitment/home/components/enterpriseList/index.vue
  30. 152 0
      src/subPages/pages/commitment/home/components/promiseList/index.vue
  31. 138 0
      src/subPages/pages/commitment/home/components/recentlySearch/index.vue
  32. 11 0
      src/subPages/pages/commitment/home/components/resultSearch/index.vue
  33. 85 0
      src/subPages/pages/commitment/home/components/templateList/index.vue
  34. 35 0
      src/subPages/pages/commitment/home/components/topSearchShow/index.vue
  35. 193 0
      src/subPages/pages/commitment/home/index.vue
  36. 50 0
      src/subPages/pages/commitment/indicatorConfirm/index.vue
  37. 0 138
      src/subPages/pages/commitment/list/index.vue
  38. 0 44
      src/subPages/pages/commitment/myCommitmentRemind/index.vue
  39. 0 87
      src/subPages/pages/commitment/myCommitmentRemind/remind-list/index.vue
  40. 1 0
      src/utils/fetch/READEME.md
  41. 14 0
      src/utils/fetch/errCode.js
  42. 26 0
      src/utils/fetch/handleReqLoading.js
  43. 218 0
      src/utils/fetch/index.js
  44. 37 0
      src/utils/fetch/requestHandler.js
  45. 48 0
      src/utils/fetch/responseHandler.js

+ 95 - 86
package-lock.json

@@ -3703,44 +3703,6 @@
           "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
           "dev": true
         },
-        "ansi-styles": {
-          "version": "4.3.0",
-          "resolved": "https://registry.npmmirror.com/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.2",
-          "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
-          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "ansi-styles": "^4.1.0",
-            "supports-color": "^7.1.0"
-          }
-        },
-        "color-convert": {
-          "version": "2.0.1",
-          "resolved": "https://registry.npmmirror.com/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.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
-          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
-          "dev": true,
-          "optional": true
-        },
         "globby": {
           "version": "9.2.0",
           "resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz",
@@ -3757,13 +3719,6 @@
             "slash": "^2.0.0"
           }
         },
-        "has-flag": {
-          "version": "4.0.0",
-          "resolved": "https://registry.npmmirror.com/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",
@@ -3776,25 +3731,6 @@
           "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
           "dev": true
         },
-        "json5": {
-          "version": "2.2.3",
-          "resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz",
-          "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
-          "dev": true,
-          "optional": true
-        },
-        "loader-utils": {
-          "version": "2.0.4",
-          "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz",
-          "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "big.js": "^5.2.2",
-            "emojis-list": "^3.0.0",
-            "json5": "^2.1.2"
-          }
-        },
         "slash": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz",
@@ -3809,28 +3745,6 @@
           "requires": {
             "minipass": "^3.1.1"
           }
-        },
-        "supports-color": {
-          "version": "7.2.0",
-          "resolved": "https://registry.npmmirror.com/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-loader-v16": {
-          "version": "npm:vue-loader@16.8.3",
-          "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
-          "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "chalk": "^4.1.0",
-            "hash-sum": "^2.0.0",
-            "loader-utils": "^2.0.0"
-          }
         }
       }
     },
@@ -21017,6 +20931,101 @@
         "vue-style-loader": "^4.1.0"
       }
     },
+    "vue-loader-v16": {
+      "version": "npm:vue-loader@16.8.3",
+      "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
+      "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
+      "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.npmmirror.com/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.2",
+          "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
+          }
+        },
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.3",
+          "resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz",
+          "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
+          "dev": true,
+          "optional": true
+        },
+        "loader-utils": {
+          "version": "2.0.4",
+          "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz",
+          "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
+          "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.npmmirror.com/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.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.3.tgz",

+ 1 - 1
src/api/alarm.js

@@ -1,4 +1,4 @@
-import { fetch as myFetch} from './fetch';
+import {  myFetch} from '../utils/fetch';
 import { httpApi } from '@/common/js/baseUrl'; 
 import zlbApi from "@/api/zlbApi";
 // 保存反映信息 '/callingPolice/save'

+ 83 - 2
src/api/commitment.js

@@ -3,7 +3,7 @@
  */
 
 import zlbApi from "@/api/zlbApi";
-import {fetch as myFetch} from "@/api/fetch";
+import {commonUpload,  myFetch} from "@/utils/fetch";
 
 /**
  * 模板列表
@@ -57,4 +57,85 @@ export function getPromiseList (data) {
 export function getEnterpriseDetail (data) {
     const url = zlbApi.getEnterpriseDetail;
     return myFetch(url, 'get', data, 'json');
-}
+}
+
+/**
+ * 获取企业列表
+ * /promise/enterprise/getList
+ */
+export function getEnterpriseList (data) {
+    const url = zlbApi.getEnterpriseList;
+    return myFetch(url, 'get', data, 'json');
+}
+
+/**
+ * 获取搜索记录
+ * /promise/common/getSearchRecordList
+ */
+export function getSearchRecordList (data) {
+    const url = zlbApi.getSearchRecordList;
+    return myFetch(url, 'get', data, 'json');
+}
+
+/**
+ * 删除搜索记录
+ * /promise/common/deleteSearchRecord
+ */
+export function deleteSearchRecord (data) {
+    const url = zlbApi.deleteSearchRecord;
+    return myFetch(url, 'post', data, 'json');
+}
+
+/**
+ * 综合搜索
+ * /promise/common/searchCommitment
+ */
+export function searchCommitment (data) {
+    const url = zlbApi.searchCommitment;
+    return myFetch(url, 'get', data, 'json');
+}
+
+/**
+ * 承诺核查列表
+ * /promise/verify/getPromiseVerifyList
+ */
+export function getPromiseVerifyList (data) {
+    const url = zlbApi.getPromiseVerifyList;
+    return myFetch(url, 'get', data, 'json');
+}
+
+/**
+ * 核查详情
+ * /promise/verify/getVerifyDetails
+ */
+export function getVerifyDetails (data) {
+    const url = zlbApi.getVerifyDetails;
+    return myFetch(url, 'get', data, 'json');
+}
+
+/**
+ * 上传图片
+ * /promise/Indicator/uploadFile
+ */
+export function uploadFile (data) {
+    const url = zlbApi.uploadFile;
+    return myFetch(url,'get',data,'formData');
+}
+
+/**
+ * 下载文件
+ * /promise/Indicator/downFileBase64
+ */
+export function downFileBase64 (data) {
+    const url = zlbApi.downFileBase64;
+    return myFetch(url, 'get', data, 'json');
+}
+
+/**
+ * 编辑核查/批量编辑
+ * /promise/verify/editVerifyTask
+ */
+export function editVerifyTask (data) {
+    const url = zlbApi.editVerifyTask;
+    return myFetch(url, 'post', data, 'json');
+}

+ 1 - 1
src/api/control.js

@@ -1,4 +1,4 @@
-import {fetch as myFetch,uploadImg} from './fetch';
+import { myFetch} from '../utils/fetch';
 import { httpApi } from '../common/js/baseUrl'; // ocr识别
 import zlbApi from '@/api/zlbApi';
 

+ 1 - 1
src/api/family.js

@@ -1,4 +1,4 @@
-import { fetch as myFetch } from "./fetch";
+import {  myFetch } from "../utils/fetch";
 import { httpApi } from "@/common/js/baseUrl";
 import zlbApi from "@/api/zlbApi";
 // 家庭成员列表查询 '/doorplateFamilyMember/getDoorplateFamilyMemberList'

+ 0 - 350
src/api/fetch.js

@@ -1,350 +0,0 @@
-import { getPlatformEnv } from "@/utils";
-import { mgop } from "@aligov/jssdk-mgop";
-import zlbConfig from "@/common/js/zlbConfig";
-import { getQuery } from "@/utils";
-import zlbApi from "@/api/zlbApi";
-import {httpApi} from "@/common/js/baseUrl";
-let requestNum = 0;
-// 请求地址为一下数组项时,请求不带请求头
-const ignoreHeader = ["https://restapi.amap.com/v3/geocode/geo"];
-function beginLoading(noLoading) {
-  if (noLoading) return;
-
-  if (requestNum === 0) {
-    uni.showLoading({
-      title: "加载中",
-    });
-  }
-
-  requestNum++;
-}
-
-function endLoading(noLoading) {
-  if (noLoading) return;
-  requestNum--;
-
-  if (requestNum <= 0) {
-    requestNum = 0;
-    uni.hideLoading();
-  }
-}
-
-function getAppId() {
-  const platform = uni.getSystemInfoSync().uniPlatform;
-  const env = getPlatformEnv();
-  let appId = "";
-  switch (platform) {
-    case "mp-weixin":
-      appId = "wx";
-      break;
-    case "mp-alipay":
-      appId = "zfb";
-      break;
-    default:
-      if (env.bIsAlipayMini) {
-        appId = "zlb_zfb";
-      } else if (env.bIsDtDreamApp) {
-        appId = "zlb_app";
-      } else if (env.bIsWxMini) {
-        appId = "zlb_wx";
-      } else {
-        //web端测试
-        appId = "zlb_app";
-      }
-      break;
-  }
-
-  return appId;
-}
-
-function fetch(url, type = "get", data = {}, dataType, noLoading = false) {
-  beginLoading(noLoading);
-  return new Promise((resolve, reject) => {
-    (url && url.startsWith("mgop.alibaba") )? handleMgop(url, type, data, dataType, noLoading, resolve, reject) : handleFetch(url, type, data, dataType, noLoading, resolve, reject);
-  });
-}
-
-function uploadImg(url, filePath, formData = {}, noLoading = false) {
-  beginLoading(noLoading);
-  return new Promise((resolve, reject) => {
-    uni.uploadFile({
-      url: url,
-      filePath: filePath,
-      fileType: "image",
-      name: "file",
-      formData,
-      header: {
-        "content-type": "multipart/form-data",
-        src: "wechat", // 小程序免登陆
-        appid: getAppId(),
-      },
-      // 设置请求的 header
-      success: function (res) {
-        console.log("uploadImg--res", res);
-        if (res.statusCode === 200 || res.statusCode === "200") {
-          let item = res.data ? JSON.parse(res.data) : {};
-          if (item.code === 0 || item.code === "0") {
-            resolve(item);
-          } else {
-            // eslint-disable-next-line prefer-promise-reject-errors
-            reject();
-            uni.showToast({
-              title: "服务异常",
-              icon: "none",
-              duration: 2000,
-            });
-          }
-        } else {
-          uni.showToast({
-            title: "服务异常",
-            icon: "none",
-            duration: 2000,
-          });
-        }
-
-        endLoading(noLoading);
-      },
-      fail: function (res) {
-        console.log("uploadImg--fail", res); // eslint-disable-next-line prefer-promise-reject-errors
-
-        uni.showToast({
-          title: "服务异常",
-          icon: "none",
-          duration: 2000,
-        });
-        reject();
-        endLoading(noLoading);
-      },
-    });
-  });
-}
-
-function download(url, type = "get", data = {}, noLoading = false) {
-  beginLoading(noLoading);
-  return new Promise((resolve, reject) => {
-    uni.request({
-      url: url,
-      method: type,
-      responseType: "arraybuffer",
-      header: {
-        "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
-        src: "wechat",
-        appid: getAppId(),
-      },
-      data: data,
-      timeout: 10000,
-      success: function (res) {
-        endLoading(noLoading);
-        console.log("返回结果:", res);
-        if (res.statusCode === 200) {
-          resolve(res);
-        } else {
-          reject(); // 接口不正常 reject
-          uni.showToast({ title: "服务异常", icon: "none" });
-        }
-      },
-      fail: function (err) {
-        endLoading(noLoading);
-        uni.showToast({ title: "服务异常", icon: "none" });
-        reject(err);
-      },
-    });
-  });
-}
-// 通用版upload,支持files或filePath方式上传
-function commonUpload(config = { noLoading: false }) {
-  const noLoading = config.noLoading ? true : false;
-  beginLoading(noLoading);
-  return new Promise((resolve, reject) => {
-    uni.uploadFile({
-      ...config,
-      header: {
-        /*   "content-type": "multipart/form-data", */
-        src: "wechat", // 小程序免登陆
-        appid: getAppId(),
-      },
-      // 设置请求的 header
-      success: function (res) {
-        console.log("uploadImg--res", res);
-        if (res.statusCode === 200 || res.statusCode === "200") {
-          let item = res.data ? JSON.parse(res.data) : {};
-          if (item.code === 0 || item.code === "0") {
-            resolve(item);
-          } else {
-            // eslint-disable-next-line prefer-promise-reject-errors
-            reject();
-            uni.showToast({
-              title: "服务异常",
-              icon: "none",
-              duration: 2000,
-            });
-          }
-        } else {
-          uni.showToast({
-            title: "服务异常",
-            icon: "none",
-            duration: 2000,
-          });
-        }
-
-        endLoading(noLoading);
-      },
-      fail: function (res) {
-        console.log("uploadImg--fail", res); // eslint-disable-next-line prefer-promise-reject-errors
-
-        uni.showToast({
-          title: "服务异常",
-          icon: "none",
-          duration: 2000,
-        });
-        reject();
-        endLoading(noLoading);
-      },
-    });
-  });
-}
-
-
-function handleMgop(url, type, data, dataType, noLoading, resolve, reject) {
-  let extraHeader = {};
-  // || window.location.href.includes('lastTest')
-  // if (
-  //   uni.getEnvVersion() === "development"
-  // ) {
-  /*  当请求头 isTestUrl 为 "1" 时,使用联调环境 */
-  extraHeader.isTestUrl = "1";
-  // }
-  mgop({
-    api: url, // 必填
-    // host: 'https://mapi.zjzwfw.gov.cn/',
-    dataType: "JSON",
-    type: type,
-    data: data,
-    appKey: zlbConfig.appKey, // 必填
-    header: {
-      "Content-Type":
-          dataType === "form"
-              ? "application/x-www-form-urlencoded"
-              : "application/json",
-      src: "wechat", // 小程序免登陆
-      appid:
-          url === zlbApi.getAllIntegrationAppList ? "zlb_app" : getAppId(), //请求applist特殊处理,因为支付宝端未配置
-      ...extraHeader,
-    },
-    onSuccess: (res) => {
-      endLoading(noLoading);
-      console.log("-----返回结果:",url, res,'-----');
-      const code = res.ret[0].split("::")[0];
-      if (code === "1000") {
-        if (
-            res.data.code === 0 ||
-            res.data.code === "0" ||
-            res.data.status === 0 ||
-            res.data.status === "1" //高德地图
-        ) {
-          resolve(res.data);
-        } else {
-          //特殊处理下,获取门牌数据的接口code是1 ,是业务错误
-          if(res.api==="mgop.alibaba.digitalDoorplate.getHomePageOneDoorplateFullInfo"){
-            resolve(res.data);
-          }else{
-            reject(res);
-            if (res.data.message || res.data.msg) {
-              uni.showToast({
-                title: res.data.message || res.data.msg,
-                icon: "none",
-                duration: 2000,
-              });
-            }
-          }
-
-        }
-      } else {
-        reject(res); // 接口不正常 reject
-        endLoading(noLoading);
-        uni.showToast({
-          title: "服务异常",
-          icon: "none",
-          duration: 2000,
-        });
-      }
-    },
-    onFail: (err) => {
-      endLoading(noLoading);
-      reject(err);
-    },
-  });
-}
-
-
-function handleFetch(url, type, data, dataType, noLoading, resolve, reject) {
-  let header = {};
-  if (ignoreHeader.indexOf(url) === -1) {
-    header = {
-      "Content-Type":
-          dataType === "form"
-              ? "application/x-www-form-urlencoded"
-              : "application/json",
-      src: "wechat", // 小程序免登陆
-      appid: getAppId(),
-      Token:'1'
-    };
-  } else {
-    header = {
-      "Content-Type":
-          dataType === "form"
-              ? "application/x-www-form-urlencoded"
-              : "application/json",
-      Token:'1'
-    };
-  }
-  uni.request({
-    url: httpApi + url,
-    method: type,
-    header,
-    data: data,
-    timeout: 60000,
-    success: function (res) {
-      endLoading(noLoading);
-      if (res.statusCode === 200) {
-        if (
-            res.data.code === 0 ||
-            res.data.code === "0" ||
-            res.data.status === 0 ||
-            res.data.status === "1" //高德地图
-        ) {
-          resolve(res.data);
-        } else {
-          reject();
-          if (res.data.message || res.data.msg) {
-            uni.showToast({
-              title: res.data.message || res.data.msg,
-              icon: "none",
-              duration: 2000,
-            });
-          }
-        }
-      } else {
-        reject(); // 接口不正常 reject
-
-        uni.showToast({
-          title: "服务异常",
-          icon: "none",
-          duration: 2000,
-        });
-      }
-    },
-    fail: function (err) {
-      console.log("err", err);
-      endLoading(noLoading);
-      uni.showToast({
-        title: "服务异常",
-        icon: "none",
-        duration: 2000,
-      });
-      reject(err);
-    },
-    complete: function () {},
-  });
-}
-export { uploadImg, fetch, download, commonUpload };

+ 1 - 1
src/api/help.js

@@ -1,4 +1,4 @@
-import {fetch as myFetch} from './fetch';
+import { myFetch} from '../utils/fetch';
 import { httpApi } from '@/common/js/baseUrl'; 
 import zlbApi from "@/api/zlbApi";
 // 保存求助信息 '/callingHelp/save'

+ 1 - 1
src/api/map.js

@@ -1,4 +1,4 @@
-import { fetch as myFetch } from "./fetch";
+import {  myFetch } from "../utils/fetch";
 
 const amapFile = require("@/libs/amap-wx.130.js");
 // 高德地图微信组件

+ 1 - 1
src/api/notice.js

@@ -1,4 +1,4 @@
-import { fetch as myFetch, download } from "./fetch";
+import {  myFetch, download } from "../utils/fetch";
 import { httpApi } from "@/common/js/baseUrl";
 import zlbApi from "@/api/zlbApi";
 // 查询公告列表 '/notice/page'

+ 1 - 1
src/api/place.js

@@ -1,4 +1,4 @@
-import {fetch as myFetch} from './fetch';
+import { myFetch} from '../utils/fetch';
 import { httpApi } from '@/common/js/baseUrl'; 
 import zlbApi from "@/api/zlbApi";
 // 获取地名文化信息通过代码 '/namesCulture/getByCode'

+ 1 - 1
src/api/rent.js

@@ -1,4 +1,4 @@
-import { fetch as myFetch } from "./fetch";
+import {  myFetch } from "../utils/fetch";
 import { httpApi } from "@/common/js/baseUrl";
 import zlbApi from "@/api/zlbApi";
 // 发布房屋 '/fwzlRentOut/add'

+ 1 - 1
src/api/scanCode.js

@@ -1,4 +1,4 @@
-import {fetch as myFetch} from './fetch';
+import { myFetch} from '../utils/fetch';
 import zlbApi from "@/api/zlbApi";
 
 

+ 10 - 1
src/api/system.js

@@ -1,4 +1,4 @@
-import { fetch as myFetch, uploadImg, download, commonUpload } from "./fetch";
+import {  myFetch, download, commonUpload } from "../utils/fetch";
 import { httpApi } from "@/common/js/baseUrl";
 import zlbApi from "@/api/zlbApi";
 // 字典查询接口 '/system/getDictionaryByName'
@@ -31,3 +31,12 @@ export function downloadFile(data) {
   const url = zlbApi.fileDownload; // '/file/download?fileUuid'
   return download(url, "get", data);
 }
+
+/**
+ * 浙政钉 获取用户信息
+ * /system/ZzdLogin
+ */
+export function ZzdLogin(data) {
+  const url = zlbApi.ZzdLogin;
+    return myFetch(url, "get", data, "json");
+}

+ 1 - 1
src/api/user.js

@@ -1,4 +1,4 @@
-import { fetch as myFetch } from "./fetch";
+import {  myFetch } from "../utils/fetch";
 import { httpApi } from "@/common/js/baseUrl";
 import zlbApi from "@/api/zlbApi";
 // 获取个人身份信息 '/userCenter/getUserInfo'

+ 1 - 1
src/api/wx.js

@@ -1,4 +1,4 @@
-import { fetch as myFetch } from "./fetch";
+import {  myFetch } from "../utils/fetch";
 import { httpApi } from "@/common/js/baseUrl";
 const platform = uni.getSystemInfoSync().uniPlatform;
 console.log('platform',platform)

+ 10 - 0
src/api/zlbApi.js

@@ -111,6 +111,16 @@ const zlbApi = {
     "createPromise": "/promise/manage/createPromise", // 创建承诺的API路径
     "getPromiseList": "/promise/manage/getList", //获取承诺列表
     "getEnterpriseDetail": "/promise/enterprise/getDetail", // 获取企业详情的API路径
+    "getEnterpriseList": "/promise/enterprise/getList", // 获取企业列表的API路径
+    "getSearchRecordList":"/promise/common/getSearchRecordList", // 获取搜索记录的API路径
+    "deleteSearchRecord":"/promise/common/deleteSearchRecord", // 删除搜索记录的API路径
+    "searchCommitment":"/promise/common/searchCommitment", // 搜索承诺的API路径
+    "ZzdLogin": "/system/ZzdLogin", // 浙政钉 获取用户信息
+    "getPromiseVerifyList": "/promise/verify/getPromiseVerifyList", // 获取承诺审核列表
+    "getVerifyDetails": "/promise/verify/getVerifyDetails", // 获取审核详情
+    "uploadFile": '/promise/Indicator/uploadFile', // 上传文件
+    "downFileBase64": '/promise/Indicator/downFileBase64', // 下载文件
+    "editVerifyTask":'/promise/verify/editVerifyTask', // 编辑核查/批量编辑
 }
 
 export default zlbApi;

+ 2 - 0
src/components/common-upload/README.md

@@ -0,0 +1,2 @@
+# 通用的上传组件
+创建原因 : 之前的上传组件 不能够适用于企业信用的上传,所以需要重新设计一个上传组件

+ 62 - 0
src/components/common-upload/index.vue

@@ -0,0 +1,62 @@
+<script>
+export default {
+  props:{
+    /* 接受最大数量 */
+    maxCount:{
+      type:Number,
+      default:1
+    },
+    /* 接受的类型 */
+    accept:{
+      type:Array,
+      default:['image/*']
+    },
+    /* 图片文件列表 */
+    value:{
+      type:Array,
+      default:[]
+    }
+  },
+  computed:{
+    fileList:{
+      get(){
+        return this.value
+      },
+      set(value){
+        this.$emit('input',value)
+      }
+    }
+  },
+  methods: {
+    chooseFile() {
+      uni.chooseFile
+    }
+  }
+}
+</script>
+
+<template>
+  <view class="file-upload">
+    <view class="upload-btn" @click="chooseFile">
+      <image class="upload-icon" src="@/static/images/upload/jiahao.png" mode="center"  alt="" />
+    </view>
+  </view>
+</template>
+
+<style scoped lang="scss">
+.file-upload {
+  border: 1px solid #ccc;
+  .upload-icon {
+    width:60px;
+    height:60px;
+  }
+  .upload-btn {
+    width:60px;
+    height:60px
+  }
+  img {
+    width: 100%;
+    height: 100%;
+  }
+}
+</style>

+ 10 - 63
src/pages.json

@@ -252,28 +252,22 @@
           }
         },
         {
-          "path": "pages/commitment/list/index",
-          "style": {
-            "navigationBarTitleText": "经营承诺列表"
-          }
-        },
-        {
           "path": "pages/commitment/commitmentDetail/index",
             "style": {
                 "navigationBarTitleText": "经营承诺详情"
             }
         },
         {
-          "path": "pages/commitment/myCommitment/index",
-            "style": {
-                "navigationBarTitleText": "我的经营承诺"
-            }
+          "path": "pages/commitment/enterpriseCommitment/index",
+          "style": {
+            "navigationBarTitleText": "企业经营承诺"
+          }
         },
         {
-          "path": "pages/commitment/myCommitmentRemind/index",
-            "style": {
-                "navigationBarTitleText": "承诺提醒"
-            }
+          "path": "pages/commitment/home/index",
+          "style": {
+            "navigationBarTitleText": "经营承诺"
+          }
         }
       ]
     }
@@ -283,55 +277,8 @@
     "navigationBarTitleText": "uni-app",
     "navigationBarBackgroundColor": "#356eed",
     "backgroundColor": "#F8F8F8",
-    // #ifdef MP-WEIXIN || MP-ALIPAY
-    "navigationStyle":"default",
-    // #endif 
-      // #ifdef H5
-      "navigationStyle":"custom",
-      // #endif   
-    // #ifdef MP-WEIXIN
-    "usingComponents": {
-      "van-search": "/wxcomponents/search/index",
-      "van-icon": "/wxcomponents/icon/index",
-      "van-button": "/wxcomponents/button/index",
-      "van-field": "/wxcomponents/field/index",
-      "van-popup": "/wxcomponents/popup/index",
-      "van-cell": "/wxcomponents/cell/index",
-      "van-cell-group": "/wxcomponents/cell-group/index",
-      "van-radio": "/wxcomponents/radio/index",
-      "van-radio-group": "/wxcomponents/radio-group/index",
-      "van-notice-bar": "/wxcomponents/notice-bar/index",
-      "van-sticky": "/wxcomponents/sticky/index",
-      "van-tab": "/wxcomponents/tab/index",
-      "van-tabs": "/wxcomponents/tabs/index",
-      "van-steps": "/wxcomponents/steps/index",
-      "van-rate": "/wxcomponents/rate/index",
-      "van-uploader": "/wxcomponents/uploader/index"
-    }
-    // #endif  
-    // #ifdef MP-ALIPAY
-    "usingComponents": {
-			"van-search": "/mycomponents/vant-aliapp/dist/dist/search/index",
-      "van-icon": "/mycomponents/vant-aliapp/dist/dist/icon/index",
-      "van-button": "/mycomponents/vant-aliapp/dist/dist/button/index",
-      "van-field": "/mycomponents/vant-aliapp/dist/dist/field/index",
-      "van-popup": "/mycomponents/vant-aliapp/dist/dist/popup/index",
-      "van-cell": "/mycomponents/vant-aliapp/dist/dist/cell/index",
-      "van-cell-group": "/mycomponents/vant-aliapp/dist/dist/cell-group/index",
-      "van-radio": "/mycomponents/vant-aliapp/dist/dist/radio/index",
-      "van-radio-group": "/mycomponents/vant-aliapp/dist/dist/radio-group/index",
-      "van-notice-bar": "/mycomponents/vant-aliapp/dist/dist/notice-bar/index",
-      "van-sticky": "/mycomponents/vant-aliapp/dist/dist/sticky/index",
-      "van-tab": "/mycomponents/vant-aliapp/dist/dist/tab/index",
-      "van-tabs": "/mycomponents/vant-aliapp/dist/dist/tabs/index",
-      "van-steps": "/mycomponents/vant-aliapp/dist/dist/steps/index",
-      "van-rate": "/mycomponents/vant-aliapp/dist/dist/rate/index",
-      "van-uploader": "/mycomponents/vant-aliapp/dist/dist/uploader/index"
-    }
-    // #endif
-   // #ifdef H5
-   "usingComponents": {}
-   // #endif 
+    "navigationStyle":"custom",
+    "usingComponents": {}
   },
   "tabBar": {
 		"color": "#7A7E83",

+ 17 - 13
src/pages/blank/blank.vue

@@ -1,5 +1,5 @@
 <template>
-  <view class="blank-page"></view>
+  <view class="blank-page"> 空白页</view>
 </template>
 
 <script>
@@ -10,7 +10,7 @@ import { storageUserInfo } from "@/utils/index";
 import Track from "@/common/js/track";
 import Vconsole from "vconsole";
 import dd from "gdt-jsapi";
-import {getTemplateList} from "@/api/commitment";
+import {ZzdLogin} from "@/api/system";
 const app = getApp();
 export default {
   name: "blank",
@@ -20,17 +20,7 @@ export default {
     return {};
   },
   onShow() {
-//    if (app.globalData.isLogin) {
-//      ZWJSBridge.close();
-//    } else {
-//      this.unityLogin()
-//    }
-    dd.getAuthCode({
-//      corpId: ""
-    }).then(res => {
-      console.log(res)
-    }).catch(err => {})
-
+    this.handleLogin()
   },
   methods: {
     async getNewSsoUserInfo(ticket) {  
@@ -249,6 +239,20 @@ export default {
       }
       return result;
     },
+
+
+    /* 获取用户信息,免登 */
+    async handleLogin(){
+      const res = await dd.getAuthCode({
+        corpId: '50329019'
+      })
+      if(res) {
+        const loginRes  =  await ZzdLogin({
+          code: res.code
+        })
+        console.log('loginRes',loginRes)
+      }
+    }
   },
 };
 </script>

二进制
src/static/images/commitment/bg2.png


+ 20 - 45
src/store/modules/template.js

@@ -1,71 +1,46 @@
 import Vue from "vue";
-import {templateDetails} from "@/api/commitment";
-import {fetch as myFetch} from "@/api/fetch";
+import {getPromiseVerifyList, templateDetails} from "@/api/commitment";
+import { myFetch} from "@/utils/fetch";
 
 const state = {
     templateJson: {
         components:[]
-    }
+    },
+    indicatorList: []
 }
 
 const mutations = {
     setTemplateComponents(state, data) {
         Vue.set(state.templateJson,'components',data)
     },
-    //    修改setTemplateJson对应的组件配置
-    setComponentValue(state,{index,value}){
-        Vue.set(state.templateJson.components[index],'value',value)
-    },
-    // 修改inputValue
-    setComponentInputValue(state,{index,value}){
-        Vue.set(state.templateJson.components[index],'inputValue',value)
-    },
+    setIndicatorList(state, data) {
+        Vue.set(state, 'indicatorList', data)
+    }
 
 }
 
 const actions = {
-    async getTemplateList({commit}, uuid) {
+    async getPromiseDetail({ commit }, uuid) {
         try {
-            const res = await templateDetails({
-                uuid,
+            let result = await getPromiseVerifyList({
+                uuid
             })
-            if (res.data && res.data.templateBody) {
-                const result = handleResponse(res.data)
-                commit('setTemplateComponents', result)
+            if (result.data && result.data.promiseBody) {
+                commit('setTemplateComponents', JSON.parse(result.data.promiseBody))
             } else {
                 commit('setTemplateComponents', [])
             }
-        } catch (e) {
+            if(result.data && result.data.list) {
+                commit('setIndicatorList', result.data.list.records)
+            }else {
+                commit('setIndicatorList', [])
+            }
+        }
+        catch (e) {
             console.log(e)
         }
-    }
-}
-
-const handleResponse = (data)  =>{
-    let result = JSON.parse(data.templateBody)
-    console.log('res',result)
 
-    //如果有指标组件,对指标组件进行数据补充
-    result.forEach( async item => {
-        if(item.base.moduleName === "Instructions") {
-            //对所有包含fetchConfig的组件进行数据请求
-            for(let i = 0; i < item.config.length; i++) {
-                if(item.config[i].fetchConfig) {
-                    let fetchConfig = item.config[i].fetchConfig
-                    let res = await myFetch(fetchConfig.api, 'get', fetchConfig.params, 'json')
-                    res = res.data
-                    item.config[i].options = res[fetchConfig.resListKey].map( resItem => {
-                        return {
-                            value: resItem[fetchConfig.valueKey],
-                            name: resItem[fetchConfig.nameKey],
-                            ...resItem
-                        }
-                    })
-                }
-            }
-        }
-    })
-    return result
+    }
 }
 
 export default {

+ 329 - 102
src/subPages/pages/commitment/commitmentDetail/components/IndicatorComponents.vue

@@ -1,95 +1,295 @@
 <script>
+import {downFileBase64, editVerifyTask, uploadFile} from "@/api/commitment";
+import {v4 as uuidv4} from "uuid";
+
 export default {
   name: "IndicatorComponents",
-  props: {
-    index: {
-      type: Number,
-      default: -1
-    },
-  },
   computed: {
-    configInfo: {
-      get() {
-        return this.$store.state.template.templateJson? this.$store.state.template.templateJson.components[this.index] :{}
-      }
+    indicatorList() {
+      return this.$store.state.template.indicatorList.map(item => {
+        if (item.indicatorInputBody) {
+          item.indicatorInputBody = item.indicatorInputBody.replace('&', item.inputBody + item.inputSegment)
+        }
+        return item
+      })
     },
-    indicate() {
-      if (this.configInfo.config[0]) {
-        const options = this.configInfo.config[0].options
-        const result = options.find(item => item.value === this.configInfo.config[0].value)
-        return result ? result : {}
-      } else {
-        return ''
-      }
+  },
+  watch: {
+    indicatorList: {
+      handler(value) {
+        if (value && value.length > 0 && !this.formStatesInitFlag) {
+          value.forEach((item) => {
+            this.$nextTick(() => {
+              this.$set(this.formStates, item.uuid, {
+                fileList: []
+              })
+            })
+          })
+          this.formStatesInitFlag = true
+        }
+      },
+      immediate: true,
+      deep: true
+    }
+  },
+  data() {
+    return {
+      formStatesInitFlag: false,
+      formStates: {},
+      checkResultColumns: [
+        {
+          text: '整改',
+          value: 1
+        },
+        {
+          text: '整改扣分',
+          value: 2
+        },
+        {
+          text: '符合',
+          value: 0
+        }
+      ],
+      checkGoalColumns: [
+        {
+          text: '整改 0分',
+          value: 0
+        },
+        {
+          text: '整改扣分 -10分',
+          value: -10
+        },
+        {
+          text: '符合',
+          value: 0
+        }
+      ],
+      checkResultPopupVisible: false,
+      checkScorePopupVisible: false,
+    }
+  },
+  methods: {
+    onCheckResultSubmit(indicateItem) {
+      console.log(this.formStates)
+      editVerifyTask([
+        {
+          uuid: indicateItem.uuid,
+          promiseId: indicateItem.promiseId,
+          indicatorId: indicateItem.indicatorId,
+          indicatorInput: indicateItem.indicatorInput,
+          indicatorInputBody: indicateItem.indicatorInputBody,
+          auditor: '张三', // 为了调试写死
+          auditResult: this.checkResultColumns.find(item => item.text === this.formStates[indicateItem.uuid].auditResult).value,
+          auditScore: this.checkGoalColumns.find(item => item.text === this.formStates[indicateItem.uuid].auditScore).value,
+          auditRemark: this.formStates[indicateItem.uuid].auditRemark,
+          //文件上传字段
+          expandStr: this.formStates[indicateItem.uuid].fileList.map(item => item.uuid).join(','),
+          isDelete: 0
+        }
+      ]).then(res => {
+        if (res.code === 0) {
+          this.$toast('核查成功')
+        }
+      })
     },
-//    是否显示指标名称
-    isShowIndicatorName() {
-      if (this.configInfo.config[3]) {
-        return this.configInfo.config[3].value !== "0"
-      } else {
-        return false
-      }
+    handleCheckResultConfirm(value, uuid) {
+      this.formStates[uuid].auditResult = value.text
+      this.checkResultPopupVisible = false
     },
-//    指标是否选中
-    isIndicatorChecked:{
-      get(){
-        return this.configInfo.value
-      },
-      set(value){
-        this.$store.commit('template/setComponentValue', {index: this.index, value})
-      }
+    handleCheckGoalConfirm(value, uuid) {
+      this.formStates[uuid].auditScore = value.text
+      this.checkScorePopupVisible = false
     },
-//    指标中输入项的值
-    indicatorInputValue:{
-      get(){
-        return this.configInfo.inputValue
-      },
-      set(value){
-        this.$store.commit('template/setComponentInputValue', {index: this.index, value})
+    beforeUpload(file) {
+      const isLt50M = file.size / 1024 / 1024 < 50;
+      if (!isLt50M) {
+        this.$toast('上传的图片大小不能超过 50MB!');
+        return false;
       }
+      return true;
     },
-    indicatorBodyStringList() {
-      return this.indicate.indicatorBody ? this.indicate.indicatorBody.split('') : [];
+    afterRead(file, uuid) {
+      const formData = new FormData()
+
+      uploadFile({
+        uuid: uuidv4(),
+        file: formData
+      }).then(res => {
+        if (res.code === 0) {
+          this.formStates[uuid].fileList.push({
+            uuid: res.data,
+            url: URL.createObjectURL(file.file)
+          })
+          console.log('上传成功', this.formStates)
+        }
+      })
     },
-  },
-  methods: {
-    onClickCheckbox(event) {
-      event.preventDefault()
+    /* 附件下载 */
+    handleFileDown(item) {
+      downFileBase64({
+        uuid: item
+      }).then(res => {
+        if (res.code === 0) {
+          const a = document.createElement('a')
+          a.href = res.data
+          a.download = '附件'
+          a.click()
+        }
+      })
     }
   }
 }
 </script>
 
 <template>
-  <view  class="indicator-style">
-    <view v-if="isShowIndicatorName">
-      {{ indicate.name }}
-    </view>
-    <view
-        :style="{
-         'min-height': configInfo.height + 'px',
-         'line-height': configInfo.height + 'px',
-       }"
-    >
-      <view class="checkbox-wrapper">
-        <van-checkbox  v-if="indicate.value" v-model="isIndicatorChecked" class="check-label">
-        </van-checkbox >
-        <span v-for="(item,index) in indicatorBodyStringList" :key="index">
-            <span v-if="item !== '&'">{{ item }}</span>
-            <span v-if="item === '&'" class="center-horizontally">
-              <input
-                  class="input-style"
-                  v-model="indicatorInputValue"
-                  @click.native="onClickCheckbox"
-              />
-            <span>
-              {{ indicate.inputSegment }}
-            </span>
-            </span>
-          </span>
-        <view :class="{
-          overlay: $route.query.isShow
-        }"></view>
+  <view>
+    <view v-for="(item,index) in indicatorList" :key="index" class="indicator-style">
+      <view class="indicator-body">
+        {{ item.indicatorInputBody }}
+      </view>
+      <view v-if="!item.approvalStatus && item.approvalStatus !== 0">
+        <view class="title">监管核查
+          <view>涉及整改、整改扣分结果,需要走审批二次确认</view>
+        </view>
+        <van-divider/>
+        <van-form v-if="formStates[item.uuid]" @submit="onCheckResultSubmit(item)">
+          <!--核查结果-->
+          <van-field
+              readonly
+              clickable
+              name="auditResult"
+              :value="formStates[item.uuid].auditResult"
+              label="核查结果"
+              placeholder="请选择核查结果"
+              @click="checkResultPopupVisible = true"
+          />
+          <van-popup v-model="checkResultPopupVisible" position="bottom">
+            <van-picker
+                show-toolbar
+                value-key="text"
+                :columns="checkResultColumns"
+                @confirm="(value)=>handleCheckResultConfirm(value,item.uuid)"
+                @cancel="checkResultPopupVisible = false"
+            />
+          </van-popup>
+          <!--核查得分-->
+          <van-field
+              readonly
+              clickable
+              name="auditScore"
+              :value="formStates[item.uuid].auditScore"
+              label="核查得分"
+              placeholder="请选择核查得分"
+              @click="checkScorePopupVisible = true"
+          />
+          <van-popup v-model="checkScorePopupVisible" position="bottom">
+            <van-picker
+                show-toolbar
+                value-key="text"
+                :columns="checkGoalColumns"
+                @confirm="(value)=>handleCheckGoalConfirm(value,item.uuid)"
+                @cancel="checkScorePopupVisible = false"
+            />
+          </van-popup>
+          <!--核查说明-->
+          <van-field
+              clickable
+              name="auditRemark"
+              v-model="formStates[item.uuid].auditRemark"
+              label="核查说明"
+              type="textarea"
+              placeholder="请输入核查说明"
+          />
+          <!--附件上传-->
+          <van-field label="文件上传">
+            <template #input>
+              <view class="upload-files">
+                <view
+                    v-for="item in formStates[item.uuid].fileList"
+                >
+                  <img :src="item.url" style="width: 80px; height: 80px;"/>
+                </view>
+                <van-uploader v-if="formStates[item.uuid].fileList.length < 3"
+                              :before-upload="beforeUpload"
+                              accept="image/*,pdf"
+                              :after-read="(file)=>afterRead(file,item.uuid)"
+                >
+                </van-uploader>
+              </view>
+              <view class="upload-description">
+                <view>
+                  支持png、jpg、pdf,最大50M
+                </view>
+                <view>
+                  最多3个附件
+                </view>
+              </view>
+            </template>
+          </van-field>
+
+          <view style="margin: 16px;">
+            <van-button round block type="info" native-type="submit">核查确认</van-button>
+          </view>
+        </van-form>
+      </view>
+      <view v-else>
+        <view class="other-title">
+          监管核查
+          <view style="color: #FF6B00" v-if="item.approvalStatus === 0">
+            审批状态:待审批
+          </view>
+          <view style="color: #15BE50" v-if="item.approvalStatus === 1">
+            审批状态:已通过
+          </view>
+          <view style="color: #D40000" v-if="item.approvalStatus === 2">
+            审批状态:已拒绝
+          </view>
+        </view>
+        <van-divider/>
+        <van-form v-if="formStates[item.uuid]">
+          <!--核查结果-->
+          <van-field
+              name="auditResult"
+              label="核查结果"
+          >
+            <template #input>
+              <view v-if="item.auditResult === 0">符合</view>
+              <view v-if="item.auditResult === 1">整改</view>
+              <view v-if="item.auditResult === 2">整改扣分</view>
+            </template>
+          </van-field>
+          <!--核查得分-->
+          <van-field
+              name="auditScore"
+              label="核查得分"
+          >
+            <template #input>
+              <view v-if="item.auditScore === 0">0分</view>
+              <view v-if="item.auditScore === -10">-10分</view>
+            </template>
+          </van-field>
+          <!--核查说明-->
+          <van-field
+              name="auditRemark"
+              label="核查说明"
+          >
+            <template #input>
+              <view>{{ item.auditRemark }}</view>
+            </template>
+          </van-field>
+          <van-field
+              name="expandStr"
+              label="附件"
+          >
+            <template #input>
+              <view class="file-style">
+                <view v-for="(item,index) in item.expandStr.split(',')" @click="handleFileDown(item)">
+                  附件{{ index + 1 }}
+                </view>
+              </view>
+            </template>
+          </van-field>
+        </van-form>
       </view>
     </view>
   </view>
@@ -97,40 +297,67 @@ export default {
 
 <style scoped lang="scss">
 .indicator-style {
-  width: 100%;
-  //border: 1px solid #ebeef5;
+  min-height: 40px;
+  border: 1px solid #e8e8e8;
   margin: 10px 0;
+  padding: 5px
 }
-.checkbox-wrapper {
-  position: relative;
-  width: 100%;
-  display: flex;
+
+.indicator-body {
+  background: #F6F6F6;
+  border-radius: 4px;
+  font-weight: 400;
+  font-size: 15px;
+  color: #666666;
+  text-align: justify;
+  padding: 5px;
+  min-height: 40px;
+}
+
+.title {
+  font-size: 14px;
+  font-weight: bold;
+  color: #333;
+  margin-top: 10px;
+
+  view {
+    color: #FF6B00;
+    font-size: 12px;
+    margin-top: 5px;
+  }
 }
-.check-label {
-  margin-right: 5px;
+
+.upload-description {
+  font-weight: 400;
+  font-size: 14px;
+  color: #666666;
 }
-.center-horizontally {
+
+.upload-files {
   display: flex;
-  align-items: center;
+  flex-direction: column;
 }
 
-.overlay {
-  position: absolute;
-  top: 0;
-  left: 0;
-  right: 0;
-  bottom: 0;
-  background: transparent; /* 确保透明,不干扰视觉效果 */
-  cursor: not-allowed; /* 可选,提供视觉反馈 */
-  z-index: 1; /* 确保遮罩在最上层 */
-}
-:deep(.el-checkbox__label) {
-  white-space:normal;
+.other-title {
+  font-size: 14px;
+  font-weight: bold;
+  color: #333;
+  margin-top: 10px;
+  display: flex;
+  justify-content: space-between;
+
+  view {
+    font-size: 12px;
+  }
 }
-.input-style {
-  width: 50px;
-  padding: 0 5px;
-  display: inline-block;
-  border-bottom: 1px solid #000;
+
+.file-style {
+  font-size: 14px;
+  font-weight: 400;
+  color: #1492FF;
+  margin-top: 10px;
+  display: flex;
+  flex-direction: column;
+  cursor: pointer;
 }
 </style>

+ 2 - 7
src/subPages/pages/commitment/commitmentDetail/components/InputComponents.vue

@@ -35,14 +35,9 @@ export default {
  }"
       class="init-style"
   >
-  <span v-if="!placeholderValue">
+  <span>
     {{inputValue}}
   </span>
-    <span v-else
-          style="color: #c0c4cc;"
-    >
-    {{placeholderValue}}
-  </span>
   </view>
 </template>
 
@@ -56,7 +51,7 @@ export default {
 .init-style{
   margin: 10px 0;
   padding: 0 10px;
-  //border: 1px solid #ebeef5;
+  border: 1px solid #ebeef5;
   word-wrap: break-word;
 }
 </style>

+ 4 - 46
src/subPages/pages/commitment/commitmentDetail/index.vue

@@ -9,8 +9,6 @@ export default {
   components: {IndicatorComponents, DividerComponents, InputComponents, DescriptionText},
   data() {
     return {
-      formData: {},
-      loading: false
     };
   },
   computed: {
@@ -24,43 +22,11 @@ export default {
     }
   },
   mounted() {
-    this.$store.dispatch('template/getTemplateList', this.$route.query.uuid)
+    this.$store.dispatch('template/getPromiseDetail', this.$route.query.uuid)
   },
   methods: {
     handleClose() {
-      this.$router.push({path: '/subPages/pages/commitment/list/index'})
-    },
-    async handleSubmit() {
-      //筛选出来指标,并且选中
-      const indicatorList = this.templateJson.components.map((item,index)=>{
-        if(item.base.moduleName === 'Instructions' && item.value){
-          return {
-            indicatorId: item.config[0].value,
-            sort: index,
-            inputBody: item.inputValue,
-          }
-        }
-      })
-      this.loading = true
-      try {
-        const res = await createPromise({
-          templateId: this.$route.query.uuid,
-          templateJson: JSON.stringify(this.templateJson),
-          companyId: 'e1', //暂写死
-          items:indicatorList
-        })
-        if(res.code === 0) {
-          uni.showToast({
-            title: '提交成功',
-            icon: 'success',
-            duration: 2000
-          })
-        }
-        this.loading = false
-      }catch (e) {
-        this.loading = false
-      }
-
+      window.history.go(-1)
     },
     handleDownPdf() {
       this.$router.push({path: '/commitment'})
@@ -73,24 +39,16 @@ export default {
   <view class="h5-page">
     <view class="page-content">
       <view
-          v-for="(item,index) in templateJson.components" :key="index"
+          v-for="(item,index) in templateJson.components.slice(0,6)" :key="index"
       >
         <DescriptionText v-if="item.base.moduleName === 'InstructionsText'" :index="index"></DescriptionText>
         <InputComponents v-else-if="item.base.moduleName === 'Input'" :index="index"></InputComponents>
         <DividerComponents v-else-if="item.base.moduleName === 'divider'" :index="index"></DividerComponents>
-        <IndicatorComponents v-else-if="item.base.moduleName === 'Instructions'" :index="index"></IndicatorComponents>
-      </view>
-      <view v-if="$route.query.uuid" class="page-content-bottom">
-        <!--这里创建承诺的时候,是从用户信息获取的浙里办的企业信息-->
-        <view>{{ formData.enterprise && formData.enterprise.companyName }}</view>
-        <view>{{ formData.createTime | date('YYYY-MM-DD HH:mm:ss') }}</view>
-        <view>法人:{{ formData.enterprise && formData.enterprise.corpRep }}</view>
-        <view>联系方式:{{ formData.enterprise && formData.enterprise.contactPhone }}</view>
       </view>
+      <IndicatorComponents></IndicatorComponents>
     </view>
     <view class="page-bottom">
       <van-button plain type="primary" @click="handleClose">关闭</van-button>
-      <van-button type="info" @click="handleSubmit" :loading="loading" loading-type="spinner">确认承诺</van-button>
       <van-button type="info" @click="handleDownPdf">下载PDF</van-button>
     </view>
   </view>

+ 1 - 1
src/subPages/pages/commitment/myCommitment/components/number-list/index.vue → src/subPages/pages/commitment/enterpriseCommitment/components/number-list/index.vue

@@ -12,7 +12,7 @@ export default {
       default: 0
     },
     //承诺项目提醒数
-    c: {
+    commitmentRemindNum: {
       type: Number,
       default: 0
     },

+ 1 - 1
src/subPages/pages/commitment/myCommitment/index.vue → src/subPages/pages/commitment/enterpriseCommitment/index.vue

@@ -1,5 +1,5 @@
 <script>
-import NumberList from "@/subPages/pages/commitment/myCommitment/components/number-list/index.vue";
+import NumberList from "@/subPages/pages/commitment/enterpriseCommitment/components/number-list/index.vue";
 import {getEnterpriseDetail, getPromiseList} from "@/api/commitment";
 
 export default {

+ 90 - 0
src/subPages/pages/commitment/home/components/contentMenu/index.vue

@@ -0,0 +1,90 @@
+<script>
+export default {
+  data() {
+    return {
+    };
+  },
+  props:{
+    value: {
+      type: Number,
+      default: 0,
+    },
+  },
+  computed: {
+    activeIndex: {
+      get() {
+        return this.value;
+      },
+      set(val) {
+        this.$emit("update:value", val);
+      },
+    },
+  },
+  methods: {
+    setActive(index) {
+      this.activeIndex = index;
+    },
+  },
+};
+</script>
+
+<template>
+  <view class="menu-container">
+    <view
+      class="menu-item"
+      :class="{ active: activeIndex === 0,left: activeIndex === 0 }"
+      @click="setActive(0)"
+    >
+      承诺列表
+    </view>
+    <view
+      class="menu-item"
+      :class="{ active: activeIndex === 1,right: activeIndex === 1 }"
+      @click="setActive(1)"
+    >
+      企业列表
+    </view>
+  </view>
+</template>
+
+<style lang='scss' scoped>
+.menu-container {
+  display: flex;
+  overflow: hidden;
+  transition: all 0.3s ease;
+  background-color: #e0f7ff;
+  width: 100%;
+  border-radius: 14px 14px 0 0;
+}
+.menu-item {
+  flex: 1;
+  text-align: center;
+  line-height: 43px;
+  cursor: pointer;
+}
+.active {
+  background-image: url("@/static/images/commitment/bg2.png");
+  background-repeat: no-repeat;
+  background-size: 100%;
+  color: #1492ff;
+  position: relative;
+}
+ .left {
+    background-position: -3px center; /* 向左偏移10像素 */
+  }
+  .right {
+    background-position: 3px center; 
+  }
+.active::after {
+  content: "";
+  display: block;
+  width: 9%;
+  height: 3px;
+  background-color: #1492ff;
+  position: absolute;
+  bottom: 5px;
+  left: 45%;
+  border-radius: 5px;
+  transition: all 0.3s ease;
+}
+</style>

+ 125 - 0
src/subPages/pages/commitment/home/components/enterpriseList/index.vue

@@ -0,0 +1,125 @@
+<script>
+import {getEnterpriseList} from "@/api/commitment";
+
+export default {
+  props:{
+    propDataList: {
+      type: Array,
+      default: () => []
+    },
+    /* 如果为true则不再使用接口请求 */
+    noRequest: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      enterpriseList: [],
+      loading: false,
+      finished: false,
+      current: 0,
+      size: 10
+    };
+  },
+  mounted() {
+    if(this.noRequest) {
+      this.finished = true;
+      this.loading = false;
+    }else {
+      this.handleGetEnterpriseList()
+    }
+  },
+  watch: {
+    propDataList: {
+      handler(val) {
+        if(this.noRequest) {
+          this.enterpriseList = val
+        }
+      },
+      deep:true
+    }
+  },
+  methods: {
+    /* 获取企业列表 */
+    async handleGetEnterpriseList() {
+      this.loading = true;  // 开始加载
+      try {
+        const res = await getEnterpriseList({
+          current: this.current + 1,
+          size: this.size
+        });
+        if (res.data.records) {
+          this.enterpriseList = this.enterpriseList.concat(res.data.records || [])
+          this.finished = res.data.records.length < this.size;  // 判断是否还有更多数据
+        }
+        this.loading = false;  // 加载结束
+      } catch (e) {
+        console.log(e);
+        this.loading = false;
+      }
+    }
+  }
+};
+</script>
+
+<template>
+  <van-list
+      v-model="loading"
+      @load="handleGetEnterpriseList"
+      :finished="finished"
+      finished-text="没有更多数据了"
+  >
+    <van-cell
+        v-for="(item, index) in enterpriseList"
+        :key="item.uuid"
+        class="box"
+    >
+      <template #default>
+        <view class="top">
+          <view class="name">
+            {{ item.companyName }}
+            <van-tag round color="#f4a40d" style="margin-left: 5px"> {{item.creditGoal }}</van-tag>
+          </view>
+        </view>
+        <view class="details">
+          最新承诺时间 : {{ item.createTime | date("YYYY-MM-DD HH:mm:ss") }}
+        </view>
+      </template>
+    </van-cell>
+  </van-list>
+</template>
+
+
+<style scoped lang="scss">
+.box {
+  min-height: 78px;
+  background: #FFFFFF;
+  border-radius: 6px;
+  margin: 12px 10px;
+  width: auto;
+
+  .top {
+    display: flex;
+    justify-content: space-between;
+
+    .name {
+      font-size: 16px;
+      font-weight: bold;
+      flex: 1;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      display: flex;
+    }
+  }
+
+  .details {
+    font-size: 14px;
+    color: #666666;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+}
+</style>

+ 152 - 0
src/subPages/pages/commitment/home/components/promiseList/index.vue

@@ -0,0 +1,152 @@
+<script>
+import {getPromiseList} from "@/api/commitment";
+
+export default {
+  props:{
+    propDataList: {
+      type: Array,
+      default: () => []
+    },
+    /* 如果为true则不再使用接口请求 */
+    noRequest: {
+      type: Boolean,
+      default: false
+    },
+    /* 模板的uuid */
+    templateId: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      promiseList: [],
+      loading:false,
+      finished:false,
+      current:0
+    };
+  },
+  mounted() {
+    if(this.noRequest) {
+      this.finished = true;
+      this.loading = false;
+    }
+  },
+  watch: {
+    propDataList: {
+      handler(val) {
+        if(this.noRequest) {
+          this.promiseList = val
+        }
+      },
+      deep:true
+    },
+    templateId: {
+      handler(val) {
+        if(val) {
+          this.promiseList = []
+          this.current = 0
+          this.handleGetPromiseList()
+        }
+      },
+      immediate:true
+    }
+  },
+  methods: {
+    /* 获取承诺列表 */
+    async handleGetPromiseList() {
+      try {
+        this.loading = true;  // 开始加载
+        const res = await getPromiseList({
+          current:this.current + 1,
+          size:10,
+          templateId:this.templateId ? this.templateId : undefined //暂时隐藏掉,以便看到数据
+        })
+       if(res.code === 0) {
+         this.promiseList = this.promiseList.concat(res.data.records || [])
+         this.current++;
+         this.finished = res.data.records.length < 10;
+       }
+       this.loading = false;  // 加载结束
+      } catch (e) {
+        console.log(e)
+        this.loading = false
+      }
+    },
+    handleParseTitle(title) {
+      if (!title) return ''
+      try {
+        return JSON.parse(title).title
+      } catch (e) {
+        return ''
+      }
+    },
+    handlePromiseClick(item) {
+      this.$router.push({
+        path: '/subPages/pages/commitment/commitmentDetail/index',
+        query: {
+          uuid: item.uuid
+        }
+      })
+    }
+  },
+};
+</script>
+
+<template>
+  <van-list v-model="loading" @load="handleGetPromiseList" :finished="finished" finished-text="没有更多数据了">
+    <van-cell v-for="(item,index) in promiseList" :key="index" class="box" @click="handlePromiseClick(item)">
+      <template #default>
+        <view class="top">
+          <view class="title">{{ handleParseTitle(item.remark) }}</view>
+          <view class="time">{{ item.create_time | date("MM-DD HH:mm:ss") }}</view>
+        </view>
+        <view class="content">承诺企业 : {{ item.company_name }}</view>
+      </template>
+    </van-cell>
+  </van-list>
+</template>
+
+<style scoped lang="scss">
+.box {
+  min-height: 78px;
+  background: #FFFFFF;
+  border-radius: 6px;
+  margin: 12px auto;
+
+  view:first-child {
+    margin-top: 0;
+  }
+}
+
+.top {
+  display: flex;
+  justify-content: space-between;
+  padding: 10px 20px;
+}
+
+.title {
+  font-size: 16px;
+  font-weight: bold;
+  flex: 1;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.time {
+  font-size: 12px;
+  color: #999999;
+  width: 100px;
+}
+
+.content {
+  padding: 0 20px;
+  font-size: 14px;
+  color: #666666;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+</style>

+ 138 - 0
src/subPages/pages/commitment/home/components/recentlySearch/index.vue

@@ -0,0 +1,138 @@
+<template>
+  <view>
+    <view class="search-header">
+      <view class="search-title">最近在搜</view>
+      <view class="search-actions">
+        <transition>
+          <van-icon v-show="!isDelete" name="delete-o" class="icon-delete" @click="handleCompleteStatus(true)"/>
+        </transition>
+        <transition>
+          <view v-show="isDelete" class="delete-controls">
+            <span class="clear-text" @click="handleHistoryEmpty">清空</span>
+            <van-button type="primary" size="small" @click="handleCompleteStatus(false)">完成</van-button>
+          </view>
+        </transition>
+      </view>
+    </view>
+    <view class="search-suggestions">
+      <view
+          v-for="item in searchSuggestion"
+          :key="item.uuid"
+          class="suggestion-item"
+          @touchstart.passive="startLongPress"
+          @touchend="endLongPress"
+      >
+        <van-icon name="clock-o"/>
+        <span class="item-text" @click='handleSearch(item)'>{{ item.searchCriteria }}</span>
+        <transition>
+          <van-icon name="close" @click="toggleDelete(item.uuid)" v-show="isDelete"/>
+        </transition>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+import {deleteSearchRecord, getSearchRecordList, searchCommitment} from "@/api/commitment";
+
+export default {
+  name: 'SearchComponent',
+  data() {
+    return {
+      isDelete: false,
+      searchSuggestion: [],
+      longPressTimer: null,
+    }
+  },
+  mounted() {
+    this.handleSearchSuggestion()
+  },
+  methods: {
+    startLongPress() {
+      this.longPressTimer = setTimeout(() => {
+        this.isDelete = true
+      }, 1000)
+    },
+    endLongPress() {
+      clearTimeout(this.longPressTimer)
+    },
+    toggleDelete(uuid) {
+      deleteSearchRecord({uuid})
+      this.handleSearchSuggestion()
+    },
+    handleHistoryEmpty() {
+      deleteSearchRecord({
+        createUser: '2'
+      })
+      this.handleSearchSuggestion()
+    },
+    handleCompleteStatus(flag) {
+      this.isDelete = flag
+    },
+    async handleSearch(item) {
+      this.$emit('search', item.searchCriteria)
+    },
+    async handleSearchSuggestion() {
+      try {
+        const res = await getSearchRecordList({
+          userId: '2'
+        })
+        this.searchSuggestion = res.data.slice(0, 6)
+      } catch (e) {
+        console.log(e)
+      }
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.search-header {
+  display: flex;
+  justify-content: space-between;
+  padding: 0.625rem 0.5rem;
+  border-bottom: 1px solid #ccc;
+}
+
+.search-title {
+  display: flex;
+  align-items: center;
+}
+
+.search-actions {
+  display: flex;
+  align-items: center;
+}
+
+.icon-delete {
+  margin-right: 0.25rem;
+}
+
+.delete-controls {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.clear-text {
+  font-size: 12px;
+  color: #007aff;
+  margin-right: 0.5rem;
+}
+
+.search-suggestions {
+  margin: 0.375rem 0.5rem;
+  display: flex;
+  flex-wrap: wrap;
+}
+
+.suggestion-item {
+  flex-basis: 50%;
+  margin-bottom: 0.625rem;
+}
+
+.item-text {
+  margin-left: 0.25rem;
+  margin-right: 0.75rem;
+}
+</style>

+ 11 - 0
src/subPages/pages/commitment/home/components/resultSearch/index.vue

@@ -0,0 +1,11 @@
+<script setup>
+
+</script>
+
+<template>
+  
+</template>
+
+<style scoped lang="scss">
+
+</style>

+ 85 - 0
src/subPages/pages/commitment/home/components/templateList/index.vue

@@ -0,0 +1,85 @@
+<script>
+import {getTemplateList} from "@/api/commitment";
+
+export default {
+  props:{
+    activeTemplateId: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      templateList:[]
+    };
+  },
+  async mounted() {
+    await this.getTemplateList()
+    this.templateList.length && this.$emit('click', this.templateList[0])
+  },
+  methods: {
+    /* 获取模板列表 */
+    async getTemplateList() {
+      try {
+        const res = await getTemplateList({
+          current: 1,
+          size: 8,
+          departmentId:undefined,// 等登录了联调
+        })
+        this.templateList = res.data.records || []
+      } catch (e) {
+        console.log(e)
+      }
+    },
+    /* 点击模板 */
+    handleClick(item) {
+      this.$emit('click', item)
+    },
+  },
+};
+</script>
+
+<template>
+  <view class="box">
+    <view v-for="item in templateList" :key="item.uuid"
+          @click="handleClick(item)"
+          :class="{active: item.uuid === activeTemplateId}">
+      <img src="" alt="">
+      <view>{{item.name}}</view>
+    </view>
+  </view>
+</template>
+
+<style scoped lang="scss">
+//box每行显示4个,超出换行,靠右
+.box {
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: flex-start;
+  height: 188px;
+  border-radius: 0 0 6px 6px;
+  box-sizing: border-box;
+  padding: 20px 10px;
+  background-image: linear-gradient(180deg, #FFFFFF 87%, #F2F3F5 100%);
+  view {
+    margin: 0 2% 0 0;
+    width: 23%;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    view {
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      width: 100%;
+    }
+    img {
+      width: 42px;
+      height: 42px;
+    }
+  }
+}
+.active {
+  transform: scale(1.1);
+}
+</style>

+ 35 - 0
src/subPages/pages/commitment/home/components/topSearchShow/index.vue

@@ -0,0 +1,35 @@
+<script>
+export default {
+  data() {
+    return {
+    };
+  },
+  props:{
+    value: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  methods: {
+    handleClickSearch() {
+      this.$emit('update:value', true)
+    }
+  },
+};
+</script>
+
+<template>
+  <view class='search' @click="handleClickSearch">
+    <van-search
+      shape="round"
+      background="transparent"
+      placeholder="搜索企业名称、承诺名称"
+    />
+  </view>
+</template>
+
+<style scoped>
+.search {
+  padding: 10px;
+}
+</style>

+ 193 - 0
src/subPages/pages/commitment/home/index.vue

@@ -0,0 +1,193 @@
+<script>
+import TopSearchShow from "./components/topSearchShow/index.vue";
+import ContentMenu from "./components/contentMenu/index.vue";
+import PromiseList from "./components/promiseList/index.vue";
+import EnterPriseList from "./components/enterpriseList/index.vue";
+import TemplateList from "./components/templateList/index.vue";
+import RecentlySearch from "./components/recentlySearch/index.vue";
+import {searchCommitment} from "@/api/commitment";
+
+
+export default {
+  components: {
+    TopSearchShow,
+    ContentMenu,
+    PromiseList,
+    EnterPriseList,
+    TemplateList,
+    RecentlySearch
+  },
+  data() {
+    return {
+      activeIndex: 0, // 当前激活的菜单索引
+      showSearch: false, // 是否显示搜索框
+      searchValue: "", // 搜索框的值
+      resultActive: 0, // 搜索结果的tab索引
+      showSearchResult: false, // 是否显示搜索结果
+      resultList: [], // 搜索结果列表
+      activeTemplateId: null // 当前激活的模板的uuid
+    };
+  },
+  methods:{
+    // 搜索
+    async onSearch(type=0) {
+      this.showSearchResult = true;
+      this.resultActive = type;
+      try {
+        const res = await searchCommitment({
+          searchCriteria: this.searchValue,
+          createUser: 2,
+          type
+        })
+        if(type === 0) {
+          this.resultList = res.data || [];
+          this.resultList = this.resultList.map(item => {
+            return {
+              ...item,
+              company_name: item.item,
+              create_time: item.time,
+              remark: item.name
+            }
+          })
+        }else if(type === 1) {
+          this.resultList = res.data || [];
+          this.resultList = this.resultList.map(item => {
+            return {
+              ...item,
+              company_name: item.item,
+              create_time: item.time,
+              remark: item.name
+            }
+          })
+        }
+      }catch (e) {
+        console.log(e);
+      }
+    },
+    handleRecentlySearch(searchCriteria) {
+      this.searchValue = searchCriteria;
+      this.onSearch();
+    },
+    // 取消搜索
+    onCancel() {
+      this.showSearch = false;
+      this.showSearchResult = false;
+      this.searchValue = "";
+    },
+    handleTabsClick(name) {
+      this.onSearch(name)
+    },
+    /* 模板点击搜索承诺 */
+    handleTemplateClick(item) {
+      this.activeTemplateId = item.uuid
+    }
+  }
+};
+</script>
+
+<template>
+  <view>
+    <transition name="fade" mode="out-in">
+      <!-- 使用 key 属性区分不同的渲染内容 -->
+      <view v-if="!showSearch" class="content" key="not-search">
+        <view class="top-search">
+          <TopSearchShow :value.sync="showSearch"></TopSearchShow>
+          <ContentMenu class='menu' :value.sync="activeIndex"></ContentMenu>
+        </view>
+        <TemplateList
+            v-show="activeIndex === 0"
+            class="template-style"
+            :activeTemplateId="activeTemplateId"
+            @click="handleTemplateClick"></TemplateList>
+        <PromiseList
+            v-show="activeIndex === 0"
+            class="promise-style"
+            :templateId="activeTemplateId"
+        ></PromiseList>
+        <view class="enterprise-top-style" v-show="activeIndex === 1">
+          <span>综合</span>
+        </view>
+        <EnterPriseList v-show="activeIndex === 1" class="enter-style"></EnterPriseList>
+      </view>
+      <view v-else key="search" class="search-page">
+        <van-search
+            v-model="searchValue"
+            show-action
+            autofocus
+            :clearable="false"
+            placeholder="请输入搜索关键词"
+            @search="()=>onSearch(0)"
+            @cancel="onCancel"
+        />
+        <RecentlySearch v-if="!showSearchResult" @search="handleRecentlySearch" class="recently-search"></RecentlySearch>
+        <view v-else>
+          <van-tabs v-model="resultActive" background='white' color='#1492FF' type='card' @click="handleTabsClick" class="tabs-style">
+            <van-tab title="承诺信息">
+              <PromiseList :no-request="true" :prop-data-list="resultList"></PromiseList>
+            </van-tab>
+            <van-tab title="企业信息">
+              <EnterPriseList :no-request="true" ::prop-data-list="resultList"></EnterPriseList>
+            </van-tab>
+          </van-tabs>
+        </view>
+      </view>
+    </transition>
+  </view>
+</template>
+
+<style scoped>
+.top-search {
+  height: 101px;
+  position: relative;
+  background-color: #1492FF;
+
+}
+.menu {
+  position: absolute;
+  top: 58px;
+  left: 0;
+  width: 100%;
+  z-index: 1;
+}
+.template-style {
+  background-color: #fff;
+}
+
+.promise-style {
+  min-height: calc(100vh - 308px);
+  background-color: transparent;
+  padding: 0 10px;
+}
+
+.enter-style {
+  margin-top: 10px;
+}
+.enterprise-top-style {
+  width: 375px;
+  height: 51px;
+  background-image: linear-gradient(180deg, #FFFFFF 35%, #F2F3F5 100%);
+  border-radius: 0 0 6px 6px;
+  position: relative;
+
+}
+span {
+  position: absolute;
+  font-weight: 600;
+  font-size: 16px;
+  color: #333333;
+  left: 20px;
+  bottom: 15px;
+}
+
+.fade-enter-active, .fade-leave-active {
+  transition: opacity 0.2s;
+}
+.fade-enter, .fade-leave-to {
+  opacity: 0;
+}
+.tabs-style {
+  .van-tabs__nav--card{
+    margin: 0;
+  }
+}
+</style>

+ 50 - 0
src/subPages/pages/commitment/indicatorConfirm/index.vue

@@ -0,0 +1,50 @@
+<script>
+import {getPromiseVerifyList} from "@/api/commitment";
+
+export default {
+  data() {
+    return {
+      formData: {},
+    }
+  },
+  computed: {
+    uuid() {
+      return this.$route.query.uuid
+    }
+  },
+  watch: {
+    uuid: {
+      handler(value) {
+        if (value) {
+          this.getCommitmentDetail()
+        }
+      },
+      immediate: true,
+      deep: true
+    }
+  },
+  methods: {
+    /* 获取核查详情 */
+    async getCommitmentDetail() {
+      try {
+        this.formData = await getPromiseVerifyList({
+          uuid: this.uuid
+        })
+        console.log(this.formData,'1212')
+      } catch (e) {
+        console.log(e)
+      }
+    }
+  }
+}
+</script>
+
+<template>
+  <view>
+
+  </view>
+</template>
+
+<style scoped lang="scss">
+
+</style>

+ 0 - 138
src/subPages/pages/commitment/list/index.vue

@@ -1,138 +0,0 @@
-<script>
-import {getTemplateList} from "@/api/commitment";
-
-export default {
-  data() {
-    return {
-      templateList:[]
-    };
-  },
-  mounted() {
-    this.getTemplateList()
-  },
-  methods: {
-//    获取模板列表
-    async getTemplateList() {
-      try {
-        const res = await getTemplateList()
-        this.templateList = res.data.records
-      } catch (e) {
-        console.log(e)
-      }
-    },
-    goDetail(item){
-      this.$router.push({
-        path: '/subPages/pages/commitment/commitmentDetail/index',
-        query: {
-          uuid: item.uuid
-        }
-      })
-    }
-  }
-}
-</script>
-
-<template>
-  <view class="box">
-    <!--顶部背景图-->
-    <image style="width: 100%;height: 268px" src="/static/images/home/commitmentbg.png"></image>
-    <view class="content">
-      <view class="content-title">
-        <span>经营承诺列表</span>
-      </view>
-      <view class="content-items">
-        <view
-            class="content-item"
-            v-for="item in templateList"
-            :key="item.uuid"
-            @click="goDetail(item)"
-        >
-          <view
-              class="content-item-bg"
-          >
-            <image v-if="item.iconUrl"></image>
-            <van-empty v-else />
-          </view>
-          <view class="item-title">
-            {{item.name}}
-          </view>
-          <view class="item-title-desc">
-            {{item.department}}
-          </view>
-        </view>
-      </view>
-    </view>
-  </view>
-</template>
-
-<style scoped lang="scss">
-.box {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-
-}
-
-.content {
-  width: 90vw;
-  margin-top: -20px;
-  z-index: 1;
-  min-height: calc(100vh - 258px);
-  background: #FFFFFF;
-  border-radius: 10px;
-}
-
-.content-title {
-  width: 185px;
-  height: 40px;
-  background: #e7f3ff;
-  text-align: center;
-  line-height: 40px;
-  border-radius: 0 0 12px 12px;
-  margin: 0 auto;
-
-  span {
-    font-weight: 500;
-    font-size: 17px;
-    color: #2c8ddf;
-  }
-}
-.content-items {
-  margin: 20px 10px 20px;
-  display: flex;
-  flex-wrap: wrap;
-  justify-content: space-between;
-}
-.content-item {
-  width: 154px;
-  height: 228px;
-  margin-bottom: 20px;
-  border-radius: 10px;
-  border: 1px solid #F6F6F6;
-  .content-item-bg {
-    width: 154px;
-    height: 154px;
-    background: #F6F6F6;
-    border-radius: 10px;
-    .van-empty {
-      padding: 0;
-    }
-  }
-  .item-title {
-    font-size: 16px;
-    font-weight: 500;
-    color: #333333;
-    margin-top: 10px;
-    text-align: justify;
-    margin-left: 5px;
-  }
-  .item-title-desc {
-    font-weight: 400;
-    font-size: 14px;
-    color: #666666;
-    margin-top: 5px;
-    margin-left: 5px;
-  }
-}
-
-</style>

+ 0 - 44
src/subPages/pages/commitment/myCommitmentRemind/index.vue

@@ -1,44 +0,0 @@
-<script>
-import RemindList from "@/subPages/pages/commitment/myCommitmentRemind/remind-list/index.vue";
-export default {
-  components:{RemindList},
-  data() {
-    return {
-      isLoading: false,
-      count: 0
-    }
-  },
-  methods: {
-    onRefresh() {
-      setTimeout(() => {
-        this.count++
-        this.isLoading = false
-      }, 2000)
-    }
-  }
-}
-</script>
-
-<template>
-  <view class="page">
-    <van-tabs v-model="active" color="#2c8ddf" swipeable title-active-color="#2c8ddf">
-      <van-tab title="标签 1">
-        <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
-          <RemindList></RemindList>
-        </van-pull-refresh>
-      </van-tab>
-      <van-tab title="标签 2">
-        <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
-          <RemindList></RemindList>
-        </van-pull-refresh>
-      </van-tab>
-    </van-tabs>
-  </view>
-</template>
-
-<style scoped lang="scss">
-.page {
-  min-height:100vh;
-  background-color: #fff;
-}
-</style>

+ 0 - 87
src/subPages/pages/commitment/myCommitmentRemind/remind-list/index.vue

@@ -1,87 +0,0 @@
-<script>
-export default {
-  data(){
-    return {
-      listData: [
-        {
-          title: '提醒标题1',
-          status: '已完成',
-          time: '2021-08-01 12:00:00',
-          promise: '承诺1'
-        },
-        {
-          title: '提醒标题2',
-          status: '未完成',
-          time: '2021-08-02 12:00:00',
-          promise: '承诺2'
-        },
-        {
-          title: '提醒标题3',
-          status: '未完成',
-          time: '2021-08-03 12:00:00',
-          promise: '承诺3'
-        }
-      ]
-    }
-  }
-}
-</script>
-
-<template>
-  <view class="remind-list">
-    <view class="remind-list-item" v-for="(item, index) in listData" :key="index">
-      <view class="item-top">
-        <view class="left-title">{{ item.title }}</view>
-        <view class="status">{{ item.status }}</view>
-      </view>
-      <view class="list-content">
-        <view class="content-item">
-          <view class="content-key">提醒时间</view>
-          <view class="content-value">{{ item.time | date }}</view>
-        </view>
-        <view class="content-item">
-          <view class="content-key">关联承诺</view>
-          <view class="content-value">{{ item.promise }}</view>
-        </view>
-      </view>
-    </view>
-  </view>
-</template>
-
-<style scoped lang="scss">
-.remind-list-item {
-  margin-top: 20px;
-  border-bottom: 1px solid #ebeef5;
-  height: 120px
-}
-.item-top {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  padding: 0 20px;
-  height: 40px;
-}
-.left-title {
-  font-size: 16px;
-  font-weight: bold;
-}
-.status {
-  font-size: 14px;
-  color: #999;
-}
-.list-content {
-  padding: 10px 20px;
-}
-.content-item {
-  display: flex;
-  margin-bottom: 10px;
-}
-.content-key {
-  font-size: 14px;
-  color: #999;
-  width: 100px;
-}
-.content-value {
-  font-size: 14px;
-}
-</style>

+ 1 - 0
src/utils/fetch/READEME.md

@@ -0,0 +1 @@
+# 接口请求工具

+ 14 - 0
src/utils/fetch/errCode.js

@@ -0,0 +1,14 @@
+export const ErrCode = {
+    /* 成功 */
+    SUCCESS : 0,
+    /* 系统内部错误 */
+    SYSTEM_ERROR : 500,
+    /* 不存在该资源 */
+    NOT_FOUND : 404,
+}
+
+export const errCodeMsgKV = {
+    [ErrCode.SUCCESS]: '成功',
+    [ErrCode.SYSTEM_ERROR]: '系统内部错误',
+    [ErrCode.NOT_FOUND]: '不存在该资源',
+}

+ 26 - 0
src/utils/fetch/handleReqLoading.js

@@ -0,0 +1,26 @@
+/**
+ * 处理请求loading
+ * 接收一个boolean值,如果为true则loading + 1,否则loading -1
+ */
+let requestNum = 0;
+const handleReqLoading = (loadingStatus) => {
+    if (loadingStatus) {
+        requestNum++;
+    } else {
+        requestNum--;
+    }
+    if (requestNum < 0) {
+        requestNum = 0;
+    }
+    if (requestNum > 0) {
+        uni.showLoading({
+        title: '加载中',
+        mask: true
+        });
+    } else {
+        uni.hideLoading();
+    }
+
+}
+
+export default handleReqLoading;

+ 218 - 0
src/utils/fetch/index.js

@@ -0,0 +1,218 @@
+import {mgop} from "@aligov/jssdk-mgop";
+import zlbConfig from "@/common/js/zlbConfig";
+import {httpApi} from "@/common/js/baseUrl";
+import {handleHttpError, handleNormalResponse} from "@/utils/fetch/responseHandler";
+import handleReqLoading from "@/utils/fetch/handleReqLoading";
+import {handleRequest} from "@/utils/fetch/requestHandler";
+
+function download(url, type = "get", data = {}) {
+    return new Promise((resolve, reject) => {
+        uni.request({
+            url: url,
+            method: type,
+            responseType: "arraybuffer",
+            header: {
+                "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
+                src: "wechat",
+            },
+            data: data,
+            timeout: 10000,
+            success: function (res) {
+                console.log("返回结果:", res);
+                if (res.statusCode === 200) {
+                    resolve(res);
+                } else {
+                    reject(); // 接口不正常 reject
+                    uni.showToast({title: "服务异常", icon: "none"});
+                }
+            },
+            fail: function (err) {
+                uni.showToast({title: "服务异常", icon: "none"});
+                reject(err);
+            },
+        });
+    });
+}
+
+// 通用版upload
+function commonUpload(url, data, config = {}) {
+    return new Promise((resolve, reject) => {
+        uni.uploadFile({
+            url: httpApi + url,
+            ...data,
+            ...config,
+            header: {
+                "content-type": "multipart/form-data",
+                Token: '1'
+            },
+            // 设置请求的 header
+            success: function (res) {
+            },
+            fail: function (res) {
+                uni.showToast({
+                    title: "服务异常",
+                    icon: "none",
+                    duration: 2000,
+                });
+                reject();
+            },
+        });
+    });
+}
+
+function index(url, type = "get", data = {}, dataType) {
+    return new Promise((resolve, reject) => {
+        (url && url.startsWith("mgop.alibaba")) ? handleMgop(url, type, data, dataType, resolve, reject) : handleFetch(url, type, data, dataType, resolve, reject);
+    });
+}
+
+function handleMgop(url, type, data, dataType, resolve, reject) {
+    let extraHeader = {};
+    /*  当请求头 isTestUrl 为 "1" 时,使用联调环境 */
+    extraHeader.isTestUrl = "1";
+    mgop({
+        api: url, // 必填
+        // host: 'https://mapi.zjzwfw.gov.cn/',
+        dataType: "JSON",
+        type: type,
+        data: data,
+        appKey: zlbConfig.appKey, // 必填
+        header: {
+            "Content-Type":
+                dataType === "form"
+                    ? "application/x-www-form-urlencoded"
+                    : "application/json",
+            src: "wechat", // 小程序免登陆
+            ...extraHeader,
+        },
+        onSuccess: (res) => {
+            const code = res.ret[0].split("::")[0];
+            if (code === "1000") {
+                if (
+                    res.data.code === 0 ||
+                    res.data.code === "0" ||
+                    res.data.status === 0 ||
+                    res.data.status === "1" //高德地图
+                ) {
+                    resolve(res.data);
+                } else {
+                    //特殊处理下,获取门牌数据的接口code是1 ,是业务错误
+                    if (res.api === "mgop.alibaba.digitalDoorplate.getHomePageOneDoorplateFullInfo") {
+                        resolve(res.data);
+                    } else {
+                        reject(res);
+                        if (res.data.message || res.data.msg) {
+                            uni.showToast({
+                                title: res.data.message || res.data.msg,
+                                icon: "none",
+                                duration: 2000,
+                            });
+                        }
+                    }
+
+                }
+            } else {
+                reject(res); // 接口不正常 reject
+                uni.showToast({
+                    title: "服务异常",
+                    icon: "none",
+                    duration: 2000,
+                });
+            }
+        },
+        onFail: (err) => {
+            reject(err);
+        },
+    });
+}
+
+
+function handleFetch(url, type, data, dataType, resolve, reject) {
+    let header = {
+        "Content-Type":
+            dataType === "form"
+                ? "application/x-www-form-urlencoded"
+                : "application/json",
+        Token: '1'
+    };
+    uni.request({
+        url: httpApi + url,
+        method: type,
+        header,
+        data: data,
+        timeout: 60000,
+        success: function (res) {
+            if (res.statusCode === 200) {
+                if (
+                    res.data.code === 0 ||
+                    res.data.code === "0" ||
+                    res.data.status === 0 ||
+                    res.data.status === "1" //高德地图
+                ) {
+                    resolve(res.data);
+                } else {
+                    reject();
+                    if (res.data.message || res.data.msg) {
+                        uni.showToast({
+                            title: res.data.message || res.data.msg,
+                            icon: "none",
+                            duration: 2000,
+                        });
+                    }
+                }
+            } else {
+                reject(); // 接口不正常 reject
+
+                uni.showToast({
+                    title: "服务异常",
+                    icon: "none",
+                    duration: 2000,
+                });
+            }
+        },
+        fail: function (err) {
+            uni.showToast({
+                title: "服务异常",
+                icon: "none",
+                duration: 2000,
+            });
+            reject(err);
+        },
+        complete: function () {
+        },
+    });
+}
+
+//export {index, download, commonUpload};
+
+/**
+ * 封装请求
+ * @param url 请求地址
+ * @param type 请求方式
+ * @param data 请求参数
+ * @param dataType 请求数据类型
+ */
+export const myFetch = async (url, type = "get", data = {}, dataType) => {
+    const reqConfig = {
+        url: httpApi + url,
+        method: type,
+        data: data,
+        dataType: dataType,
+        timeout: 60000,
+        header: {
+            'content-type': 'application/json',
+            Token: '1'
+        },
+    }
+
+    try {
+        handleReqLoading(true);
+        const response = await handleRequest(reqConfig);
+        const responseData = handleNormalResponse(response);
+        handleReqLoading(false);
+        //返回一个promise对象
+        return responseData;
+    }catch (err) {
+        return handleHttpError(err);
+    }
+}

+ 37 - 0
src/utils/fetch/requestHandler.js

@@ -0,0 +1,37 @@
+export const handleRequest = async (reqConfig) => {
+    return new Promise((resolve, reject) => {
+
+        /** 普通请求 */
+        reqConfig.dataType === 'json' && uni.request({
+            ...reqConfig,
+            success: function (res) {
+                resolve(res.data);
+            },
+            fail: function (err) {
+                reject(err);
+            },
+        });
+
+        /** 文件上传 */
+        const uploadParams = JSON.parse(JSON.stringify(reqConfig));
+        // 上传会自己带
+        delete uploadParams.data.file;
+        reqConfig.dataType === 'formData' && uni.uploadFile({
+            url: reqConfig.url,
+            formData: uploadParams.data,
+            header: {
+               Token:uploadParams.header.Token
+            },
+            success: function (res) {
+                resolve(JSON.parse(res.data));
+            },
+            fail: function (err) {
+                reject(err);
+            },
+        });
+
+        /** 文件下载 */
+        const downloadParams = JSON.parse(JSON.stringify(reqConfig));
+
+    });
+}

+ 48 - 0
src/utils/fetch/responseHandler.js

@@ -0,0 +1,48 @@
+import {errCodeMsgKV} from "@/utils/fetch/errCode";
+
+/**
+ * 处理状态码不为200的响应
+ */
+export function handleHttpError(err) {
+    const msg = errCodeMsgKV[err.code] + ':' + err.msg || err.msg;
+    uni.showToast({
+        title: msg,
+        icon: "none",
+        duration: 2000,
+    });
+    return Promise.reject(msg);
+}
+
+
+/**
+ * 处理http响应码为200的响应
+ * @return {Promise<unknown>}
+ */
+export function handleNormalResponse(res) {
+    return new Promise((resolve, reject) => {
+        if (res.code || res.code === 0) {
+            switch (res.code) {
+                case 200:
+                    resolve(res);
+                    break;
+                case 0:
+                    resolve(res);
+                    break;
+                default:
+                    reject(res);
+                    uni.showToast({
+                        title:res.msg,
+                        icon: "none",
+                        duration: 2000,
+                    });
+            }
+        } else {
+            reject(res);
+            uni.showToast({
+                title: "服务异常",
+                icon: "none",
+                duration: 2000,
+            });
+        }
+    });
+}