xutongzee vor 1 Jahr
Ursprung
Commit
77f10086f2
3 geänderte Dateien mit 76 neuen und 72 gelöschten Zeilen
  1. 2 2
      src/store/modules/user.js
  2. 3 2
      src/views/Approve.vue
  3. 71 68
      src/views/approve/detail.vue

+ 2 - 2
src/store/modules/user.js

@@ -13,13 +13,13 @@ const state = {
     signatureStateText: '',  // 个签
 
     // 徐同泽
-    token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIxOSIsImlzcyI6Imh0dHBzOlwvXC96YWluLmNvbSIsImF1ZCI6Imh0dHBzOlwvXC96YWluLmNvbSIsImlhdCI6MTcwMjY5NzQ0NCwibmJmIjoxNzAyNjk3NDQ0LCJleHAiOjE3Mjg2MTc0NDR9.BOU8yu57KZrgUbcIGuS0a8AB91oLhH6nHawxYUQwt7U',
+    // token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIxOSIsImlzcyI6Imh0dHBzOlwvXC96YWluLmNvbSIsImF1ZCI6Imh0dHBzOlwvXC96YWluLmNvbSIsImlhdCI6MTcwMjY5NzQ0NCwibmJmIjoxNzAyNjk3NDQ0LCJleHAiOjE3Mjg2MTc0NDR9.BOU8yu57KZrgUbcIGuS0a8AB91oLhH6nHawxYUQwt7U',
 
     // 于
     // token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIyMSIsImlzcyI6Imh0dHBzOlwvXC96YWluLmNvbSIsImF1ZCI6Imh0dHBzOlwvXC96YWluLmNvbSIsImlhdCI6MTcwMjY5NzQ5MiwibmJmIjoxNzAyNjk3NDkyLCJleHAiOjE3Mjg2MTc0OTJ9.tvPS5OIrfn21LItFuUSiKgnAUu1p-9x5xwzVzxp6y20'
 
     // 物业主管
-    // token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIyMSIsImlzcyI6Imh0dHBzOlwvXC96YWluLmNvbSIsImF1ZCI6Imh0dHBzOlwvXC96YWluLmNvbSIsImlhdCI6MTcwMzAzNTg5MCwibmJmIjoxNzAzMDM1ODkwLCJleHAiOjE3Mjg5NTU4OTB9.BNRfY7re51HRSjWxDObt4D-qYCkTzgCXyLupNAoAg84'
+    token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIyMSIsImlzcyI6Imh0dHBzOlwvXC96YWluLmNvbSIsImF1ZCI6Imh0dHBzOlwvXC96YWluLmNvbSIsImlhdCI6MTcwMzAzNTg5MCwibmJmIjoxNzAzMDM1ODkwLCJleHAiOjE3Mjg5NTU4OTB9.BNRfY7re51HRSjWxDObt4D-qYCkTzgCXyLupNAoAg84'
 
     // 信息主管
     // token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIyMiIsImlzcyI6Imh0dHBzOlwvXC96YWluLmNvbSIsImF1ZCI6Imh0dHBzOlwvXC96YWluLmNvbSIsImlhdCI6MTcwMzAzODI1MywibmJmIjoxNzAzMDM4MjUzLCJleHAiOjE3Mjg5NTgyNTN9.eglTZ2-CPHUBDYyPbzk5k69Yv24J2ELTd8CN3VZL8_8'

+ 3 - 2
src/views/Approve.vue

@@ -17,8 +17,9 @@
     <div class="approve-main">
       <van-list v-model="listLoading" :finished="finished" :finished-text="finishedText" @load="onLoadData">
         <approve-item v-for="(item, idx) in tableData" :key="idx" approve-type="xx" :title="item.__title__"
-          :time="item.apply_date" :rows="item.__rows_item__" :person="tabVal != 3 ? item.approve_one.user.name : ''"
-          flag="approve" :flag-state="Number(tabVal)" @click="handleGoInfo(item)" />
+          :time="item.apply_date" :rows="item.__rows_item__"
+          :person="tabVal != 3 ? item.approve_one && item.approve_one.user.name : ''" flag="approve"
+          :flag-state="Number(tabVal)" @click="handleGoInfo(item)" />
       </van-list>
       <my-empty v-show="showEmpty" tip="暂无数据" />
     </div>

+ 71 - 68
src/views/approve/detail.vue

@@ -46,7 +46,7 @@
                 </layout>
                 <c-input title="评价" :readonly="true" :value="dataDetail.module_info.comment" />
             </div>
-            <div v-else class="evaluate">
+            <div v-else-if="pageType === 'info' && dataDetail && dataDetail.status === 3" class="evaluate">
                 请对维修结果做出评价,<span @click="showInputResd = true" class="evaluate__event">点击评价</span>
             </div>
         </template>
@@ -154,7 +154,10 @@ export default {
         title() {
             if (!this.dataDetail) return ''
             const { create_user } = this.dataDetail
-            return `${create_user.name}提交的申请单`
+            console.log('%c name???? >>>', 'background: blue; color: #fff', create_user);
+
+            if (create_user.name) return `${create_user.name}提交的申请单`
+            else return ''
         },
         ...mapState('enum', [
             'evectionTypeList',
@@ -296,72 +299,72 @@ export default {
         },
 
         // NOTE: 渲染`module_info`字段函数; 让其更好的渲染
-        async formatModuleInfoData(data) {
-            const { module, order_no, module_info, department_data } = data
-            let evectionTypeMap = this.evectionTypeList
-            if (module === 5 && evectionTypeMap) {
-                let vops = evectionTypeMap.filter(option => (option.id === module_info.type))[0]
-                module_info.type_text = vops.name
-            }
-            let temporaryList = [
-                {
-                    title: '审批编号',
-                    value: order_no
-                }
-            ]
-            switch (module) {
-                case 5:
-                    temporaryList.push(...[
-                        {
-                            title: '所在部门',
-                            value: department_data.map(department => (department.name)).join('-')
-                        },
-                        {
-                            title: '申请日期',
-                            value: data.create_at
-                            // type: 'date'
-                        },
-                        {
-                            title: '发起人',
-                            value: data.user_id
-                        },
-                        { title: '外出事由', value: module_info.reason },
-                        { title: '同行人员', value: data.peer_user.map(user => (user.name)).join('、') },
-                        { title: '出差开始时间', value: module_info.start_time },
-                        { title: '出差结束时间', value: module_info.end_time },
-
-                        module_info.document_text.length ? {
-                            title: '附件材料',
-                            type: 'files',
-                            value: module_info.document_text
-                        } : undefined,
-
-                        module_info.images_text.length ? {
-                            type: 'images',
-                            title: '图片',
-                            value: module_info.images_text
-                        } : undefined,
-
-                        {
-                            title: '类型',
-                            value: module_info.type_text
-                        },
-                        {
-                            title: '是否跨关内关外',
-                            value: module_info.is_who ? '是' : '否'
-                        },
-                        {
-                            title: module_info.is_who ? '预算金额' : '备注',
-                            value: module_info.remark
-                        }
-                    ])
-                    break
-            }
-            // NOTE: 过滤undefined的数组值
-            temporaryList = temporaryList.filter(row => row)
-            console.log('%c Render Temporary List >>>', 'background: blue; color: #fff', temporaryList.filter(row => row));
-            return Promise.resolve(temporaryList)
-        }
+        // async formatModuleInfoData(data) {
+        //     const { module, order_no, module_info, department_data } = data
+        //     let evectionTypeMap = this.evectionTypeList
+        //     if (module === 5 && evectionTypeMap) {
+        //         let vops = evectionTypeMap.filter(option => (option.id === module_info.type))[0]
+        //         module_info.type_text = vops.name
+        //     }
+        //     let temporaryList = [
+        //         {
+        //             title: '审批编号',
+        //             value: order_no
+        //         }
+        //     ]
+        //     switch (module) {
+        //         case 5:
+        //             temporaryList.push(...[
+        //                 {
+        //                     title: '所在部门',
+        //                     value: department_data.map(department => (department.name)).join('-')
+        //                 },
+        //                 {
+        //                     title: '申请日期',
+        //                     value: data.create_at
+        //                     // type: 'date'
+        //                 },
+        //                 {
+        //                     title: '发起人',
+        //                     value: data.user_id
+        //                 },
+        //                 { title: '外出事由', value: module_info.reason },
+        //                 { title: '同行人员', value: data.peer_user.map(user => (user.name)).join('、') },
+        //                 { title: '出差开始时间', value: module_info.start_time },
+        //                 { title: '出差结束时间', value: module_info.end_time },
+
+        //                 module_info.document_text.length ? {
+        //                     title: '附件材料',
+        //                     type: 'files',
+        //                     value: module_info.document_text
+        //                 } : undefined,
+
+        //                 module_info.images_text.length ? {
+        //                     type: 'images',
+        //                     title: '图片',
+        //                     value: module_info.images_text
+        //                 } : undefined,
+
+        //                 {
+        //                     title: '类型',
+        //                     value: module_info.type_text
+        //                 },
+        //                 {
+        //                     title: '是否跨关内关外',
+        //                     value: module_info.is_who ? '是' : '否'
+        //                 },
+        //                 {
+        //                     title: module_info.is_who ? '预算金额' : '备注',
+        //                     value: module_info.remark
+        //                 }
+        //             ])
+        //             break
+        //     }
+        //     // NOTE: 过滤undefined的数组值
+        //     temporaryList = temporaryList.filter(row => row)
+        //     console.log('%c Render Temporary List >>>', 'background: blue; color: #fff', temporaryList.filter(row => row));
+        //     return Promise.resolve(temporaryList)
+        // }
     },
     beforeDestroy() {
         if (this.isAndroid) {