Parcourir la source

修改打卡时间为10分钟

ymz il y a 1 mois
Parent
commit
b9b6fd0705

+ 2 - 3
env/.env.development

@@ -2,12 +2,11 @@ NODE_ENV=development
 
 # pre环境
 # VITE_APP_URL=https://mic.freerr.cn
-# VITE_APP_URL=http://10.144.62.235:9999
 # 生产
 # VITE_APP_URL=https://cnbg.yaoyi.net
-VITE_APP_URL=https://mic.cnbg.com.cn
+# VITE_APP_URL=https://mic.cnbg.com.cn
 # 中生测试
-# VITE_APP_URL=https://mic-t.cnbg.com.cn
+VITE_APP_URL=https://mic-t.cnbg.com.cn
 
 
 

+ 0 - 11
package-lock.json

@@ -26,7 +26,6 @@
         "dayjs": "^1.11.10",
         "eslint-config-prettier": "^9.0.0",
         "eslint-plugin-prettier": "^5.0.1",
-        "heic2any": "^0.0.4",
         "pinia-plugin-persistedstate": "^3.2.0",
         "prettier": "^3.0.3",
         "qs": "^6.11.2",
@@ -8017,11 +8016,6 @@
         "he": "bin/he"
       }
     },
-    "node_modules/heic2any": {
-      "version": "0.0.4",
-      "resolved": "https://registry.npmmirror.com/heic2any/-/heic2any-0.0.4.tgz",
-      "integrity": "sha512-3lLnZiDELfabVH87htnRolZ2iehX9zwpRyGNz22GKXIu0fznlblf0/ftppXKNqS26dqFSeqfIBhAmAj/uSp0cA=="
-    },
     "node_modules/html-encoding-sniffer": {
       "version": "2.0.1",
       "resolved": "https://registry.npmmirror.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz",
@@ -20230,11 +20224,6 @@
       "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
       "dev": true
     },
-    "heic2any": {
-      "version": "0.0.4",
-      "resolved": "https://registry.npmmirror.com/heic2any/-/heic2any-0.0.4.tgz",
-      "integrity": "sha512-3lLnZiDELfabVH87htnRolZ2iehX9zwpRyGNz22GKXIu0fznlblf0/ftppXKNqS26dqFSeqfIBhAmAj/uSp0cA=="
-    },
     "html-encoding-sniffer": {
       "version": "2.0.1",
       "resolved": "https://registry.npmmirror.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz",

+ 0 - 1
package.json

@@ -58,7 +58,6 @@
     "dayjs": "^1.11.10",
     "eslint-config-prettier": "^9.0.0",
     "eslint-plugin-prettier": "^5.0.1",
-    "heic2any": "^0.0.4",
     "pinia-plugin-persistedstate": "^3.2.0",
     "prettier": "^3.0.3",
     "qs": "^6.11.2",

+ 1 - 19
src/components/uploadImg/index.vue

@@ -46,9 +46,7 @@ const beforeUploadImg = () => {
       }
       uploadImg()
     },
-    fail: function (res) {
-      console.log('res', res)
-    }
+    fail: function (res) {}
   })
 }
 
@@ -85,8 +83,6 @@ const uploadImg = async () => {
     sizeType: ['original', 'compressed'],
     sourceType: sourceType.value,
     async success(res: any) {
-      console.log('res', res)
-
       let tempFiles = res.tempFiles
       // 当前相片来源为拍照
       if (sourceType.value[0] === 'camera') {
@@ -96,19 +92,6 @@ const uploadImg = async () => {
           tempFiles[0].path = path
         }
       }
-
-      let flag = res.tempFilePaths.every((item: string) => {
-        return item.includes('.jpg') || item.includes('.jpeg') || item.includes('.png')
-      })
-      if (!flag) {
-        uni.showToast({
-          title: '暂不支持该格式照片,请更换为png或jpg格式',
-          icon: 'none',
-          duration: 3000
-        })
-        return
-      }
-
       // 保存上传成功的数据
       const imageValue: imgType[] = []
       // 使用map而不是forEach,因为map会返回一个Promise数组
@@ -161,7 +144,6 @@ const addWatermark = (fileUrl: string) => {
         }
         const time =
           new Date().toJSON().substring(0, 10) + ' ' + new Date().toTimeString().substring(0, 8)
-
         const ctx = uni.createCanvasContext('myCanvas', _this)
         ctx.drawImage(fileUrl, 0, 0, thumbWidth.value, thumbHeight.value) //先画出图片
         ctx.setFontSize(30) //注意:设置文字大小必须放在填充文字之前,否则不生效

+ 0 - 13
src/manifest.json

@@ -71,19 +71,6 @@
     ]
   },
   "h5": {
-    "devServer": {
-      "disableHostCheck": true,
-      "proxy": {
-        "/admin": {
-          "target": "https://mic.cnbg.com.cn", //目标接口域名
-          "changeOrigin": true, // 是否跨域
-          "secure": false,
-          "pathRewrite": {
-            "^/admin": ""
-          }
-        }
-      }
-    },
     "router": {
       "base": "./"
     }

+ 7 - 2
src/pages-sub-admin/serviceManagement/index.vue

@@ -34,8 +34,13 @@ const navigateToDetail = (url: string) => {
 }
 
 const getShow = (index: number) => {
-  const hasRole37 = currentRoles.includes(37)
-  return hasRole37 ? index <= 1 : index > 1
+  if (index === 0) {
+    return !currentRoles.includes(37)
+  }
+  if (index === 1) {
+    return currentRoles.includes(37)
+  }
+  return true
 }
 </script>
 

+ 2 - 9
src/pages-sub-admin/serviceManagement/taskList.ts

@@ -24,18 +24,11 @@ export default [
     img: 'https://yy-cloud-oss.oss-cn-beijing.aliyuncs.com/img/jpdc.png'
   },
   {
-    title: '服务审核',
+    title: '服务审核',
     color: '#8E3F3B',
     role: [4],
-    url: '/pages-sub-service-mangement/servicesToBeReviewed/index',
+    url: '/pages-sub-service-mangement/taskReportapproval/index',
     backgroundColor: 'linear-gradient(94.41deg, #FFFCFC -14.28%, #F4E1E0 77.47%);',
     img: 'https://yy-cloud-oss.oss-cn-beijing.aliyuncs.com/img/kcdc.png'
-  },
-  {
-    title: '服务已审核',
-    color: '#30546E',
-    url: '/pages-sub-service-mangement/serviceReviewed/index',
-    backgroundColor: 'linear-gradient(270.93deg, #D6EDFD 0.8%, #F1F9FF 100%);',
-    img: 'https://yy-cloud-oss.oss-cn-beijing.aliyuncs.com/img/sygs.png'
   }
 ]

+ 2 - 6
src/pages-sub-mine/task-completion-records/index.vue

@@ -114,16 +114,12 @@ const onDetail = (id: string) => {
 const popup = ref()
 const reason = ref('')
 const showReason = (item: any) => {
-  console.log('item', item)
-
-  let str =
+  reason.value =
     item.approval_info ||
     item.report_one_approval_info ||
     item.report_drug_approval_info ||
     item.taskStatusInfo ||
-    item?.checkState?.checkMsg
-
-  reason.value = `"${str}"`
+    '暂无原因'
 
   popup.value.open()
 }

+ 56 - 89
src/pages-sub-service-mangement/taskAuditDetail/index.vue

@@ -47,7 +47,13 @@
 
     <view class="review-btn botton-content" v-if="showBtn">
       <view class="review-form">
-        <uv-form labelPosition="left" :model="reviewForm" ref="reviewFormRef" labelWidth="80">
+        <uv-form
+          labelPosition="left"
+          :model="reviewForm"
+          :rules="reviewFormRules"
+          ref="reviewFormRef"
+          labelWidth="80"
+        >
           <uv-form-item label="审核说明" prop="taskStatusInfo" borderBottom required>
             <uv-textarea
               v-model="reviewForm.taskStatusInfo"
@@ -58,8 +64,8 @@
         </uv-form>
       </view>
       <view class="btn">
-        <view class="cancel" @click="reviewFn(false)">拒绝</view>
-        <view class="confirm" @click="reviewFn(true)">通过</view>
+        <view class="cancel" @click="reviewFn('4')">拒绝</view>
+        <view class="confirm" @click="reviewFn('3')">通过</view>
       </view>
     </view>
   </view>
@@ -73,10 +79,7 @@ import {
   getSignInfoByTaskIdApi,
   getQrCodeByUrlApi
 } from '@/service/modules/getTask'
-
-import { approvalTaskApi } from '@/service/modules/taskAudit.ts'
-
-import { getTaskV2TokenApi, checkSingleApi } from '@/service/modules/serviceReviewed'
+import { approvalTaskApi, approvalReportApi } from '@/service/modules/taskAudit'
 
 import { onLoad } from '@dcloudio/uni-app'
 import { reactive, ref } from 'vue'
@@ -93,6 +96,7 @@ import { useLoginStore } from '@/store/login'
 
 const loginStore = useLoginStore()
 let userInfo: any = loginStore.currentUserInfo
+const roles: number[] = userInfo.roles
 
 const reviewStore = useReview()
 // 文本展示类型
@@ -129,26 +133,24 @@ onLoad((e) => {
   reviewStore.setCurrentInfo('')
 
   if (e?.show === 'true') {
-    showBtn.value = true
+    if (roles.includes(currentInfo.value.checkState.roleId)) {
+      showBtn.value = true
+    }
+
+    if ((roles.includes(40) || roles.includes(42)) && currentInfo.value.checkState.roleId == -1) {
+      showBtn.value = true
+    }
+    if (roles.includes(39) && currentInfo.value.checkState.nextNodeId == -1) {
+      showBtn.value = false
+    }
   }
 
   if (e?.id) {
     detailId.value = e.id
     getTaskDetail()
-    getToken()
   }
 })
 
-const token = ref('')
-const getToken = async () => {
-  const res = await getTaskV2TokenApi({
-    taskIds: [detailId.value]
-  })
-  if (res.code === 0) {
-    token.value = res.data.token
-  }
-}
-
 const detailInfo = ref()
 const taskTypeId = ref()
 const isShareImg = ref(false)
@@ -232,83 +234,48 @@ const reviewFormRef = ref()
 const reviewForm = reactive({
   taskStatusInfo: ''
 })
-
-const role37Review = async (flag) => {
-  let obj = {
-    id: detailId.value,
-    taskStatus: flag ? 3 : 4,
-    taskStatusInfo: reviewForm.taskStatusInfo,
-    nodeId: 1
+const reviewFormRules = reactive({
+  taskStatusInfo: {
+    type: 'string',
+    required: true,
+    message: '请输入审核说明',
+    trigger: ['blur', 'change']
   }
-  const res = await approvalTaskApi(obj)
-  if (res.code === 0) {
-    uni.showToast({
-      title: '审核成功',
-      icon: 'none'
-    })
-    setTimeout(() => {
-      uni.navigateBack()
-    }, 1000)
-  }
-}
+})
 
-const reviewFn = (flag: boolean) => {
-  if (!flag && !reviewForm.taskStatusInfo) {
-    return uni.showToast({
-      title: '请输入审核说明',
-      icon: 'none'
-    })
-  }
+const reviewFn = (flag: string) => {
   reviewFormRef.value
     .validate()
     .then(async () => {
-      let userInfo: any = loginStore.currentUserInfo
-      const roles: number[] = userInfo?.roles || []
-
-      if (roles.includes(37)) {
-        role37Review(flag)
-        return
-      }
-
-      let nodeId: any = ''
-      switch (true) {
-        // 43	地市管理员
-        case roles.includes(43):
-          nodeId = 2
-          break
-        // 4	区域管理员
-        case roles.includes(4):
-          nodeId = 3
-          break
-        // 42	市场管理员
-        case roles.includes(42):
-          nodeId = 8
-          break
-        // 40	商务管理员
-        case roles.includes(40):
-          nodeId = 9
-          break
-        // 39	事业部总经理
-        case roles.includes(39):
-          nodeId = 6
-          break
-        // 41	事业部分管领导
-        case roles.includes(41):
-          nodeId = 5
-          break
-        default:
-          nodeId = 1
-      }
-
-      let obj: any = {
-        token: token.value,
-        taskId: detailId.value,
-        checkResult: flag,
-        checkMessage: reviewForm.taskStatusInfo,
-        nodeId: nodeId
+      let obj: any = {}
+      let res
+      if (currentType.value === '1') {
+        obj = {
+          id: detailId.value,
+          taskStatus: flag,
+          taskStatusInfo: reviewForm.taskStatusInfo,
+          nodeId: currentInfo.value?.checkState.curNodeId
+        }
+        res = await approvalTaskApi(obj)
+      } else if (currentType.value === '2') {
+        obj = {
+          id: currentReportId.value,
+          taskIds: detailId.value,
+          approvalOpinion: flag == '3' ? '1' : '2',
+          approvalInfo: reviewForm.taskStatusInfo,
+          taskStatusInfo: reviewForm.taskStatusInfo,
+          nodeId: currentInfo.value?.checkState.nextNodeId
+        }
+        if (roles.includes(42)) {
+          obj.nodeId = 8
+        }
+        // 40 商务组
+        if (roles.includes(40)) {
+          obj.nodeId = 9
+        }
+        res = await approvalReportApi(obj)
       }
 
-      let res = await checkSingleApi(obj)
       if (res.code === 0) {
         uni.showToast({
           title: '审核成功',

+ 2 - 2
src/pages-sub-service-mangement/taskManagement/index.vue

@@ -59,12 +59,12 @@
             <text>{{ item.finishRate }}%</text>
           </view>
           <view class="txt">{{ item.ysh }}/{{ item.score }}</view>
-          <!-- <view class="btns">
+          <view class="btns">
             <view class="btn" @click.stop.prevent.self="generateReportFn(item)">
               <image src="@/static/images/icon/review-img2.png" class="image" />
               <text>生成报告</text>
             </view>
-          </view> -->
+          </view>
         </view>
       </view>
     </view>

+ 1 - 1
src/pages-sub-task/location/index.vue

@@ -336,7 +336,7 @@ const toDetail = () => {
   })
 
   Lock.value = true
-  let TIME: number = 15
+  let TIME: number = 10
   // 签退时间
   const signOutTime = dayjs(signResultTime.value)
   // 获取当前时间

+ 2 - 2
src/pages-sub-task/task/components/imgCom.vue

@@ -31,7 +31,7 @@
 </template>
 
 <script setup lang="ts">
-import { ref, unref, watch } from 'vue'
+import { ref, unref, onMounted, watch } from 'vue'
 import uploadImgCom from '@/components/uploadImg/index.vue'
 
 const emmits = defineEmits(['update:imgValue'])
@@ -51,7 +51,7 @@ const imgList = ref<imgType[]>([])
 
 watch(
   () => props.imgValue,
-  () => {
+  (newVal, oldVal) => {
     if (props?.imgValue) {
       let str = props?.imgValue.split(',')
       imgList.value = str.map((item) => {

+ 4 - 0
src/pages-sub-task/task/index.vue

@@ -480,10 +480,13 @@ const saveBtn = async () => {
   }
 }
 
+let isSubmitting = false
 // 提交函数
 const submitBtn = async () => {
+  if (isSubmitting) return
   if (!validateForm()) return
 
+  isSubmitting = true // 标记正在提交
   sendParams.value = {
     ...sendParams.value,
     draftKey: taskTypeId.value,
@@ -543,6 +546,7 @@ const handleError = (msg: string) => {
     content: msg,
     success: function (res) {
       if (res.confirm) {
+        isSubmitting = false // 恢复提交状态
         console.log('用户点击确定')
       }
     }

+ 0 - 14
src/pages.json

@@ -512,20 +512,6 @@
             "navigationBarTitleText": "服务审核",
             "navigationBarBackgroundColor": "#fff"
           }
-        },
-        {
-          "path": "servicesToBeReviewed/index",
-          "style": {
-            "navigationBarTitleText": "服务待审核",
-            "onReachBottomDistance": 200
-          }
-        },
-        {
-          "path": "serviceReviewed/index",
-          "style": {
-            "navigationBarTitleText": "服务已审核",
-            "onReachBottomDistance": 200
-          }
         }
       ]
     }

+ 1 - 1
src/pages/login/index.vue

@@ -169,7 +169,7 @@ async function getCode() {
     })
     const res = await getSmsCode(formData.phone)
     uni.hideLoading()
-
+    uni.hideLoading()
     if (!res.data) {
       uni.showToast({
         title: res.msg,

+ 1 - 52
src/pages/task/task-detail/components/imgCom.vue

@@ -15,7 +15,6 @@
             mode="aspectFill"
             class="img-item"
             @click="preImg(imgList, index)"
-            @error="errorImage(item, index)"
           />
         </view>
       </div>
@@ -24,10 +23,7 @@
 </template>
 
 <script setup lang="ts">
-import { onMounted, ref, getCurrentInstance } from 'vue'
-// #ifdef H5
-import heic2any from 'heic2any'
-// #endif
+import { onMounted, ref } from 'vue'
 
 const props = defineProps({
   item: Object,
@@ -68,53 +64,6 @@ const preImg = (imgList: any[], index: number) => {
     urls: arr
   })
 }
-
-// #ifdef H5
-const errorImage = async (item: any, index: number) => {
-  await handleImage(item, index)
-}
-const instance = getCurrentInstance()
-const imgValue = ref('')
-const handleImage = async (item: any, index: number) => {
-  let url = item.path
-  const response = await fetch(url)
-  const blob = await response.blob()
-
-  if (await isHeicFile(blob)) {
-    const heicImageBlob = await fetch(url).then((res) => res.blob())
-
-    // 使用 heic2any 库将 HEIC 转换为 JPG
-    heic2any({ blob: heicImageBlob, toType: 'image/jpeg' })
-      .then((convertedBlob) => {
-        // @ts-ignore
-        const imgURL = URL.createObjectURL(convertedBlob)
-        imgList.value[index].path = imgURL
-        imgValue.value = imgURL
-        instance?.proxy?.$forceUpdate()
-      })
-      .catch((err) => {
-        console.log('err', err)
-      })
-  }
-}
-
-const isHeicFile = (file: any) => {
-  return new Promise((resolve, reject) => {
-    const reader = new FileReader()
-    reader.onloadend = () => {
-      const buffer: string | ArrayBuffer | null = reader.result
-      // HEIC 文件的前几个字节为 "00 00 00 18 66 74 79 70 68 65 69 63" 或 "00 00 00 20 66 74 79 70 68 65 69 63" (小端字节序)
-      const signature = new Uint8Array(buffer as ArrayBuffer).subarray(0, 12)
-      const heicSignature = [0x00, 0x00, 0x00, 0x18, 0x66, 0x74, 0x79, 0x70, 0x68, 0x65, 0x69, 0x63]
-
-      const isHeic = signature.every((byte, index) => byte === heicSignature[index])
-      resolve(isHeic)
-    }
-    reader.onerror = reject
-    reader.readAsArrayBuffer(file)
-  })
-}
-// #endif
 </script>
 
 <style lang="scss" scoped>

+ 0 - 3
src/pages/task/task-detail/components/selectCom.vue

@@ -23,9 +23,6 @@ const getVal = () => {
   const arr = ['51', '52', '53']
   // 拜访类任务
   if (arr.includes(props.item?.taskTypeId) && props?.item.taskFiledKey === 'temp24') {
-    if (props?.detailInfo?.wmTaskContent['temp10']) {
-      return props?.detailInfo?.wmTaskContent['temp10']
-    }
     return props?.detailInfo?.wmTaskContent['temp24label']
   }
   const taskFiledKey = props?.item.taskFiledKey

+ 1 - 3
tsconfig.json

@@ -1,7 +1,6 @@
 {
   "extends": "@vue/tsconfig/tsconfig.json",
   "compilerOptions": {
-    "noImplicitAny": false,
     "sourceMap": true,
     "module": "ESNext",
     "baseUrl": ".",
@@ -10,8 +9,7 @@
     },
     "lib": ["esnext", "dom"],
     "types": ["@dcloudio/types", "node"],
-    "ignoreDeprecations": "5.0",
-    "verbatimModuleSyntax": true // 添加这一行
+    "ignoreDeprecations": "5.0"
   },
   "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
   "exclude": ["src/wxUtils/QQMapWX.ts", "src/mp_ecard_sdk"]