11 次代碼提交 6624571076 ... 221309a54f

作者 SHA1 備註 提交日期
  梦辉 221309a54f fix: 企业承诺首页模板可以滑动 3 月之前
  梦辉 db5525b6e6 fix: 指标时间格式化 3 月之前
  梦辉 fd18f256e4 fix: 时间格式化 3 月之前
  梦辉 e3a96312b6 fix: 批量核查bug修复 3 月之前
  梦辉 ba0650a6fd fix : 重新核查信息显示 3 月之前
  梦辉 487ffe3a7d fix : 核查详情得分显示具体分数 3 月之前
  梦辉 1ac208df41 fix : 企业列表无信用分的时候显示暂无 3 月之前
  梦辉 2c5aaea705 fix : 核查详情得分显示 3 月之前
  梦辉 2b286e4375 fix : 模板列表传递id过去 3 月之前
  梦辉 3969a77bcd fix : 指标状态核查查看指标详情 3 月之前
  梦辉 3dfde4a4ff ifx : 指标状态核查 3 月之前

+ 1 - 1
src/api/commitment.js

@@ -146,7 +146,7 @@ export function editVerifyTask (data) {
  */
 export function getReminderList (data) {
     const url = zlbApi.getReminderList;
-    return myFetch(url, 'get', data, 'json');
+    return myFetch(url, 'get', data, 'jsonDown');
 }
 
 /**

+ 23 - 6
src/common/js/filters.js

@@ -8,13 +8,30 @@ import moment from 'moment'
  */
 Vue.filter('date', function(value, formatString = 'YYYY-MM-DD HH:mm:ss') {
     if (!value) return '';
-//  如果是string,转换为number
+
+    // 检查是否为ISO 8601格式的时间字符串
+    const iso8601Pattern = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}\+\d{2}:\d{2}/;
+    const normalPattern = /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/;
+
+    // 如果是字符串且匹配ISO 8601格式
+    if (typeof value === 'string' && iso8601Pattern.test(value)) {
+        return moment(value).format(formatString);
+    }
+
+    // 如果是字符串且匹配正常时间格式
+    if (typeof value === 'string' && normalPattern.test(value)) {
+        return moment(value, 'YYYY-MM-DD HH:mm:ss').format(formatString);
+    }
+
+    // 如果是字符串,将其转换为数字
     if (typeof value === 'string') {
-        value = Number(value)
+        value = Number(value);
     }
-    //如果是秒级时间戳,转换为毫秒级
-    if ( typeof value === 'number' && value.toString().length === 10) {
-        value = value * 1000
+
+    // 如果是秒级时间戳,转换为毫秒级
+    if (typeof value === 'number' && value.toString().length === 10) {
+        value = value * 1000;
     }
+
     return moment(value).format(formatString);
-})
+});

+ 67 - 7
src/subPages/pages/commitment/commitmentDetail/components/IndicatorComponents.vue

@@ -20,7 +20,7 @@ export default {
               this.$set(this.formStates, indicatorItem.uuid, {
                 ...indicatorItem,
                 auditResult: this.checkResultColumns.find(item => item.value === indicatorItem.auditResult) && this.checkResultColumns.find(item => item.value === indicatorItem.auditResult).text,
-                auditScore: this.checkGoalColumns.find(item => item.value === indicatorItem.auditScore) && this.checkGoalColumns.find(item => item.value === indicatorItem.auditScore).text,
+                auditScore: indicatorItem.auditResult === 3 ? '' : indicatorItem.auditScore, //后端会直接返回过来具体的分数
                 fileList: indicatorItem.expandStr ? indicatorItem.expandStr.split(',').map(item => {
                   return {
                     uuid: item
@@ -82,6 +82,11 @@ export default {
     }
   },
   methods: {
+    /* 重新核查 */
+    handleReCommitment(indicateItem) {
+      indicateItem.auditResult = 3
+      indicateItem.auditScore = ''
+    },
     onCheckResultSubmit(indicateItem) {
       editVerifyTask([
         {
@@ -92,7 +97,6 @@ export default {
           indicatorInputBody: indicateItem.indicatorInputBody,
           auditor: uni.getStorageSync("userInfo").realName,
           auditResult: this.checkResultColumns.find(item => item.text === this.formStates[indicateItem.uuid].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) && 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(','),
@@ -102,7 +106,7 @@ export default {
         if (res.code === 0) {
           this.$toast('核查成功')
           this.formStatesInitFlag = false
-          this.$store.dispatch('template/getPromiseDetail1',this.$route.query.uuid)
+          this.$store.dispatch('template/getPromiseDetail',this.$route.query.uuid)
         }else {
           this.$toast('核查失败' + res.msg)
         }
@@ -135,7 +139,7 @@ export default {
         <view>涉及整改、整改扣分结果,需要走审批二次确认</view>
       </view>
       <van-divider/>
-      <CommitmentConfirmForm v-if="!item.approvalStatus"
+      <CommitmentConfirmForm v-if="item.auditResult === 3"
                              v-model="formStates[item.uuid]">
         <template #footer>
           <view style="margin: 16px;">
@@ -146,6 +150,9 @@ export default {
       <view v-else>
         <view class="other-title">
           监管核查
+          <view style="color: #15BE50" v-if="item.approvalStatus === 0">
+            审批状态:待审批
+          </view>
           <view style="color: #15BE50" v-if="item.approvalStatus === 1">
             审批状态:已通过
           </view>
@@ -172,8 +179,7 @@ export default {
               label="核查得分"
           >
             <template #input>
-              <view v-if="item.auditScore === 0">0分</view>
-              <view v-if="item.auditScore === -10">-10分</view>
+              {{item.auditScore }}
             </template>
           </van-field>
           <!--核查说明-->
@@ -190,14 +196,68 @@ export default {
               label="附件"
           >
             <template #input>
-              <view class="file-style">
+              <view v-if="item.expandStr" class="file-style">
                 <view v-for="(item,index) in item.expandStr.split(',')" @click="handleFileDown(item)" :key="index">
                   附件{{ index + 1 }}
                 </view>
               </view>
             </template>
           </van-field>
+          <!--核查人员-->
+          <van-field
+              style="margin-top: 16px"
+              name="auditor"
+              label="核查人员"
+          >
+            <template #input>
+              {{ item.auditor }}
+            </template>
+          </van-field>
+          <!--核查时间-->
+          <van-field
+              name="auditTime"
+              label="核查时间"
+          >
+            <template #input>
+              {{ item.updateTime | date }}
+            </template>
+          </van-field>
+
+          <view v-if="item.approvalStatus !== 0">
+            <van-divider></van-divider>
+            <view class="other-title">核查审批</view>
+            <!--审批人员-->
+            <van-field
+                name="approvalPerson"
+                label="审批人员"
+            >
+              <template #input>
+                {{ item.approvalPerson }}
+              </template>
+            </van-field>
+            <!--审批时间-->
+            <van-field
+                name="approvalTime"
+                label="审批时间"
+            >
+              <template #input>
+                {{ item.approvalTime | date }}
+              </template>
+            </van-field>
+            <!--审批说明-->
+            <van-field
+                name="approvalRemark"
+                label="审批说明"
+            >
+              <template #input>
+                {{ item.approvalRemark }}
+              </template>
+            </van-field>
+          </view>
         </van-form>
+        <view v-if="item.approvalStatus === 2" style="margin: 16px;">
+          <van-button round block type="info" @click="handleReCommitment(item)">重新核查</van-button>
+        </view>
       </view>
     </view>
   </view>

+ 29 - 9
src/subPages/pages/commitment/commitmentDetail/index.vue

@@ -14,7 +14,21 @@ export default {
       currentStep: 0,
       batchCheckForm:{
         fileList:[]
-      }
+      },
+      checkResultColumns: [
+        {
+          text: '整改',
+          value: 1
+        },
+        {
+          text: '整改扣分',
+          value: 2
+        },
+        {
+          text: '符合',
+          value: 0
+        }
+      ]
     };
   },
   computed: {
@@ -36,6 +50,10 @@ export default {
       set(value) {
         this.$store.commit('template/setIndicatorList', value)
       }
+    },
+    /* 批量核查的列表,只有auditResult为3(未核查的)和approvalStatus已拒绝(0)的 */
+    batchCheckIndicatorList(){
+      return this.indicatorList.filter(item => item.auditResult === 3 || item.approvalStatus === 0)
     }
   },
   watch:{
@@ -82,16 +100,16 @@ export default {
     },
     onCheckResultSubmit(){
       const result = []
-      this.indicatorList.forEach(item => {
+      this.batchCheckIndicatorList.forEach(item => {
         result.push({
-          "uuid": item.item,
+          "uuid": item.uuid,
           "promiseId": item.promiseId,
           "indicatorId": item.indicatorId,
           "indicatorInput": item.indicatorInput,
           "indicatorInputBody": item.indicatorInputBody,
           "auditor": uni.getStorageSync("userInfo").realName,
-          "auditResult": this.batchCheckForm.auditResult,
-          "auditScore": this.batchCheckForm.auditScore,
+          "auditResult": this.checkResultColumns.find(item => item.text === this.batchCheckForm.auditResult)
+              && this.checkResultColumns.find(item => item.text === this.batchCheckForm.auditResult).value,
           "auditRemark": this.batchCheckForm.auditRemark,
           "expandStr": this.batchCheckForm.fileList.map(item => item.uuid).join(','),
         })
@@ -100,6 +118,7 @@ export default {
         if (res.code === 0) {
           this.$toast('核查成功')
           this.actionSheetShow = false
+          this.batchCheckForm={}
           await this.$store.dispatch('template/getPromiseDetail', this.$route.query.uuid)
         }else{
           this.$toast('核查失败' + res.msg)
@@ -120,20 +139,21 @@ export default {
         <InputComponents v-else-if="item.base.moduleName === 'Input'" :index="index"></InputComponents>
         <DividerComponents v-else-if="item.base.moduleName === 'divider'" :index="index"></DividerComponents>
       </view>
-      <view class="commit-title" @click="handleBatchCommitment">批量核查</view>
+      <view class="commit-title" v-if="batchCheckIndicatorList.length > 0" @click="handleBatchCommitment">批量核查</view>
       <IndicatorComponents></IndicatorComponents>
     </view>
     <view class="page-bottom">
       <van-button plain type="primary" @click="handleClose">关闭</van-button>
       <van-button v-if="!noDownload" type="info" @click="handleDownPdf">下载PDF</van-button>
     </view>
-    <van-action-sheet v-model="actionSheetShow" title="标题">
+    <van-action-sheet v-model="actionSheetShow" title="批量核查">
       <div class="content">
         <view v-show="currentStep === 0" class="first-step">
           <van-checkbox
               shape="square"
-              v-for="(item,index) in indicatorList" :key="index" :name="index"
-              v-model="indicatorList[index].selectValue">
+              style="margin-top: 20px"
+              v-for="(item,index) in batchCheckIndicatorList" :key="index" :name="index"
+              v-model="batchCheckIndicatorList[index].selectValue">
             {{ item.indicatorInputBody }}
           </van-checkbox>
 

+ 24 - 1
src/subPages/pages/commitment/components/commitmentConfirmForm/index.vue

@@ -58,6 +58,28 @@ export default {
     handleCheckResultConfirm(value) {
       this.formStates.auditResult = value.text
       this.checkResultPopupVisible = false
+      //如果选择的不是符合,核查得分选择去掉符合
+      //先清空核查得分
+      this.formStates.auditScore = ''
+      if (this.formStates.auditResult !== '符合') {
+        this.checkGoalColumns = [
+          {
+            text: '整改 0分',
+            value: 0
+          },
+          {
+            text: '整改扣分 -10分',
+            value: -10
+          }
+        ]
+      } else {
+        this.checkGoalColumns = [
+          {
+            text: '符合',
+            value: 0
+          }
+        ]
+      }
     },
     handleCheckGoalConfirm(value) {
       this.formStates.auditScore = value.text
@@ -114,13 +136,14 @@ export default {
       <van-field
           readonly
           clickable
+          :disabled="!formStates.auditResult"
           name="auditScore"
           :value="formStates.auditScore"
           label="核查得分"
           placeholder="请选择核查得分"
           @click="checkScorePopupVisible = true"
       />
-      <van-popup v-model="checkScorePopupVisible" position="bottom">
+      <van-popup v-if="formStates.auditResult" v-model="checkScorePopupVisible" position="bottom">
         <van-picker
             show-toolbar
             value-key="text"

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

@@ -88,7 +88,7 @@ export default {
         <view class="top">
           <view class="name">
             {{ item.companyName }}
-            <van-tag round color="#f4a40d" style="margin-left: 5px"> {{item.creditGoal }}</van-tag>
+            <van-tag round color="#f4a40d" style="margin-left: 5px"> {{item.creditGoal || '暂无' }}</van-tag>
           </view>
         </view>
         <view class="details">

+ 39 - 24
src/subPages/pages/commitment/home/components/templateList/index.vue

@@ -3,7 +3,7 @@ import {downFileBase64, getTemplateList} from "@/api/commitment";
 import TemplateImg from "@/static/images/commitment/template.png";
 
 export default {
-  props:{
+  props: {
     activeTemplateId: {
       type: String,
       default: ''
@@ -11,7 +11,9 @@ export default {
   },
   data() {
     return {
-      templateList:[]
+      templateList: [],
+      current: 1,
+      size: 16
     };
   },
   async mounted() {
@@ -23,15 +25,19 @@ export default {
     async getTemplateList() {
       try {
         const res = await getTemplateList({
-          current: 1,
-          size: 8,
-          departmentId: uni.getStorageSync("userInfo").deptIdList
-              ? uni.getStorageSync("userInfo").deptIdList[uni.getStorageSync("userInfo").deptIdList.length - 1]
-              : undefined
+          current: this.current,
+          size: this.size,
+          departmentId: uni.getStorageSync("userInfo").deptId
         });
-        this.templateList = res.data.records || [];
-        for (const [index, item] of this.templateList.entries()) {
-          await this.handleDownImg(item.iconUrl, index);
+        if(res.data && res.data.records.length > 0) {
+          //每8个一组作为一个数组,push到templateList中
+          for (let i = 0; i < res.data.records.length; i += 8) {
+            this.templateList.push(res.data.records.slice(i, i + 8));
+//            //依次下载每个模板的图片
+            for (const item of this.templateList[this.templateList.length - 1]) {
+              await this.handleDownImg(item);
+            }
+          }
         }
       } catch (e) {
         console.log(e);
@@ -41,14 +47,14 @@ export default {
     handleClick(item) {
       this.$emit('click', item);
     },
-    async handleDownImg(iconUrl, index) {
-      if (!iconUrl) {
-        this.templateList[index].imgUrl = TemplateImg;
-      } else {
+    async handleDownImg(item) {
+      if (!item.iconUrl) {
+        item.imgUrl = TemplateImg;
+      } else if(!item.imgUrl) {
         let res = await downFileBase64({
-          uuid: iconUrl
+          uuid: item.iconUrl
         });
-        this.templateList[index].imgUrl = 'data:image/jpeg;base64,' + res.data;
+        item.imgUrl = 'data:image/jpeg;base64,' + res.data;
       }
     }
   }
@@ -56,14 +62,18 @@ export default {
 </script>
 
 <template>
-  <view class="box">
-    <view v-for="item in templateList" :key="item.uuid"
-          @click="handleClick(item)"
-          :class="{active: item.uuid === activeTemplateId}">
-      <img :src="item.imgUrl" style="border-radius: 5px" alt="">
-      <view class="text-overflow">{{item.name}}</view>
-    </view>
-  </view>
+  <van-swipe class="my-swipe" @change="onChange"  indicator-color="white" :loop="false">
+    <van-swipe-item  v-for="groupItem in templateList">
+      <view class="box">
+        <view v-for="item in groupItem" :key="item.uuid"
+              @click="handleClick(item)"
+              :class="{active: item.uuid === activeTemplateId}">
+          <img :src="item.imgUrl" style="border-radius: 5px" alt="">
+          <view class="text-overflow">{{ item.name }}</view>
+        </view>
+      </view>
+    </van-swipe-item>
+  </van-swipe>
 </template>
 
 <style scoped lang="scss">
@@ -77,12 +87,14 @@ export default {
   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;
@@ -90,15 +102,18 @@ export default {
       width: 100%;
       text-align: center;
     }
+
     img {
       width: 42px;
       height: 42px;
     }
   }
 }
+
 .active {
   transform: scale(1.1);
 }
+
 .text-overflow {
   overflow: hidden;
   text-overflow: ellipsis;

+ 5 - 1
src/utils/fetch/handleReqLoading.js

@@ -3,7 +3,11 @@
  * 接收一个boolean值,如果为true则loading + 1,否则loading -1
  */
 let requestNum = 0;
-const handleReqLoading = (loadingStatus) => {
+const handleReqLoading = (loadingStatus,dataType='json') => {
+    // 如果是文件下载,不显示loading
+    if(dataType === 'jsonDown'){
+        return;
+    }
     if (loadingStatus) {
         requestNum++;
     } else {

+ 3 - 3
src/utils/fetch/index.js

@@ -208,14 +208,14 @@ export const myFetch = async (url, type = "get", data = {}, dataType) => {
     }
 
     try {
-        handleReqLoading(true);
+        handleReqLoading(true,dataType);
         const response = await handleRequest(reqConfig);
         const responseData = handleNormalResponse(response);
-        handleReqLoading(false);
+        handleReqLoading(false,dataType);
         //返回一个promise对象
         return responseData;
     }catch (err) {
-        handleReqLoading(false);
+        handleReqLoading(false,dataType);
         return handleHttpError(err);
     }
 }

+ 1 - 1
src/utils/fetch/requestHandler.js

@@ -8,7 +8,7 @@ export const handleRequest = (reqConfig) => {
     const promises = [];
 
     /** 普通请求 */
-    if (reqConfig.dataType === 'json') {
+    if (reqConfig.dataType === 'json' || reqConfig.dataType === 'jsonDown') {
         const promise = new Promise((resolve, reject) => {
             uni.request({
                 ...reqConfig,